Skip to content

Commit b048d8f

Browse files
committed
feat: update example service config file
1 parent 3d42210 commit b048d8f

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

conf/systemV/etc/init.d/ghfs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ pidfile="/var/run/${prog}.pid"
2626

2727
start() {
2828
echo -n $"Starting $prog: "
29-
"$ghfs" --config=/etc/ghfs.conf &
29+
setcap CAP_NET_BIND_SERVICE=+ep "$ghfs"
30+
runuser -u nobody -- "$ghfs" --config=/etc/ghfs.conf &
3031
retval=$?
3132
echo
3233
if [ $retval -eq 0 ]; then

conf/systemd/etc/systemd/system/ghfs.service

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ After=network.target
44

55
[Service]
66
Type=simple
7-
ExecStart=/usr/local/bin/ghfs --config=/etc/ghfs.conf
7+
ExecStartPre=setcap CAP_NET_BIND_SERVICE=+ep /usr/local/bin/ghfs
8+
ExecStart=runuser -u nobody -- /usr/local/bin/ghfs --config=/etc/ghfs.conf
89
ExecReload=/bin/kill -s HUP $MAINPID
910
KillSignal=SIGTERM
1011
KillMode=process

conf/systemd/etc/systemd/system/ghfs@.service

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ After=network.target
44

55
[Service]
66
Type=simple
7-
ExecStart=/usr/local/bin/ghfs --config=/etc/ghfs_%I.conf
7+
ExecStartPre=setcap CAP_NET_BIND_SERVICE=+ep
8+
ExecStart=runuser -u nobody -- /usr/local/bin/ghfs --config=/etc/ghfs_%I.conf
89
ExecReload=/bin/kill -s HUP $MAINPID
910
KillSignal=SIGTERM
1011
KillMode=process

0 commit comments

Comments
 (0)