[systemd-devel] vncserver at .service

Reindl Harald h.reindl at thelounge.net
Wed Jan 23 06:59:45 PST 2013



Am 23.01.2013 14:48, schrieb Antonio:
> In /lib/systemd/system/vncserver at .service file, I read how to edit it
> to create a 'service unit file'.
> These lines
> 
>  >ExecStart=/sbin/runuser -l <USER> -c "/usr/bin/vncserver %i"
>  >ExecStop=/sbin/runuser -l <USER> -c "/usr/bin/vncserver -kill %i"
> 
> consider the use of 'runuser' command that causes an error when I try
> to start  'vncserver at .()service':
> 
>  >runuser: cannot set groups:Operation not permitted.
> 
> The only way, by which I can avoid it, is by erasing 'runuser' from
> Exec* lines:
> 
>   >ExecStart=/usr/bin/vncserver %i
>   >ExecStop=/usr/bin/vncserver -kill %i
> 
> But this changes extremely the 'vncserver' launch.

and why do you not use the User= and Group= options?
see below, you can even set priority and io-scheduling

[root at xxx:~]$ cat /usr/lib/systemd/system/serverstatus.service
[Unit]
Description=Serverstatus
After=network.target

[Service]
Type=simple
ExecStart=/usr/bin/php /usr/local/serverstatus/serverstatus.php
Restart=always
RestartSec=1
TimeoutSec=15
Nice=19
IOSchedulingClass=3
User=wwwcron
Group=apache

[Install]
WantedBy=multi-user.target

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 263 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20130123/8f78e547/attachment.pgp>


More information about the systemd-devel mailing list