Am 25.01.2013 17:42, schrieb Daniel J Walsh:
> How would I write a unit file to run an apache service as the user dwalsh 
> (3267)
why would someone do this with systemd?
httpd needs to get started as root to bind the port!

systemd supports such nice things but it is completly
wrong for daemons which do this native

Nice=19
IOSchedulingClass=3
User=wwwcron
Group=apache
_________________________________________

point to whatever httpd.conf and set there user/group
which has to be used after forking and bind the ports

User    apache
Group   apache
_________________________________________

[root@srv-rhsoft:~]$ cat /usr/lib/systemd/system/httpd-lounge-worker.service
[Unit]
Description=HTTP-Lounge-Worker

[Service]
Type=forking
PIDFile=/var/run/httpd/httpd-lounge-worker.pid
EnvironmentFile=/etc/sysconfig/httpd
ExecStart=/usr/sbin/httpd $OPTIONS -f 
/Volumes/dune/httpd-worker/conf/httpd.conf -k start
ExecReload=/usr/sbin/httpd $OPTIONS -f 
/Volumes/dune/httpd-worker/conf/httpd.conf -t
ExecReload=/bin/kill -HUP $MAINPID
ExecStop=/usr/sbin/httpd $OPTIONS -f /Volumes/dune/httpd-worker/conf/httpd.conf 
-k stop
Restart=always
RestartSec=1

[Install]
WantedBy=multi-user.target

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to