0

what's the role of percentage in VNC configuration?

 ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
 ExecStart=/usr/sbin/runuser -l <USER> -c "/usr/bin/vncserver %i"
 PIDFile=/home/<USER>/.vnc/%H%i.pid
 ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'

are the %i and %H variable?

  • Welcome to U&L! This looks like a systemd question -- what is the location (full path) of this file, please? – JigglyNaga Sep 26 '18 at 15:15
1

The % indicates that this is a specifier (or sometimes "format specifier"). This is a common way for config files to specify a value that may vary at runtime. In the case of this systemd file, you can find their meaning at systemd.unit:

Many settings resolve specifiers which may be used to write generic unit files referring to runtime or unit parameters that are replaced when the unit files are loaded. Specifiers must be known and resolvable for the setting to be valid. The following specifiers are understood:

[...]

  • "%H": Host name: The hostname of the running system at the point in time the unit > configuration is loaded.
  • "%i": Instance name: For instantiated units this is the string between the first "@" character and the type suffix. Empty for non-instantiated units.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.