TigerVNC's default service template

When starting a vncserver service, I notice that you could write and use a service definition or not.

To see what I mean compare these two tutorials (by the same author):

Only in one of them do you get a step for expressly writing out a service template.

Questions:

  1. From the computer’s point of view, is there an implicit default service template even when the human user did not write one out?
  2. If yes to 1, what does that implicit default template look like? (I.e. what contents does it have in it?)
  3. How could I see it? (I don’t mean link me a source, which you might do for question 2, but how could I get the computer to tell me which default template it was using? Perhaps there is a hidden file somewhere. Or the template does not exist as a file, but “in” the package tigervnc as it were, which the package could spill out on some particular command.)

As you can see, this is not a practical question. Just trying to understand. Thanks.

Manjaro uses systemd as it’s init system.

With systemd, all system tasks handled at startup - from devices to network- is handled by means of various unit files. To name a few

  • service units
  • timer units
  • mount units
  • automount units

You write a service unit when you need a specific task done once.

If the task is repeated at certain intervals you complement the service with a timer unit

The task can be anything you need to automate - below is couple of examples

You can list all unit files

systemctl list-unit-files

If an application is designed to run as a service - it provides the necessary unit files with the package.

pamac list --files tigervnc | grep '.service'

In the case with tigervnc - the package provides several binaries where a service file is provided for vncserver but none for x0vncserver.

In this case the service unit is a template because it requires a display argument. Not all service units requires arguments as can be seen from above automation examples.

Unix was not designed to stop its users from doing stupid things, as that would also stop them from doing clever things.
— Doug Gwyn

The two examples linked at your initial post is illustrating two ways of achieving different results.

  • The first is using vncserver and the predefined unit to create a secure connection to a dedicated display for one named user.
  • A second method uses x0vncserver and a custom service unit to connect screen :0 which allows anyone see what is going on.
  • A third [root tip] [How To] TigerVNC Quick Setup describes how to connect to a dedicated display for one named user but without a secure connection.

Never interrupt someone doing what you said couldn’t be done.
— Amelia Earhart

2 Likes

You can check each package provided files with pkgfile. Example for tigervnc would be:
pkgfile -l tigervnc

If you want to see specifics about vncserver provided files you can use:
pkgfile -l tigervnc | grep vncserver

You will see the file /usr/lib/systemd/system/vncserver@.service is installed but not enabled by default, hence will not start. See above how to check if a service is enabled or not.

Check the content of that file with:
cat /usr/lib/systemd/system/vncserver@.service
And you now know the defaults of it.

1 Like

Thank you. Your commands gave me exactly the information I was looking for.

I also had to run sudo pkgfile --update per instructions from terminal.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.