From 1c9dec091e003ec977c55507eed83954a7532bc1 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 14 Jan 2014 19:06:28 +0100 Subject: [PATCH] gluon-radvd: don't run as root --- package/gluon-radvd/files/etc/init.d/gluon-radvd | 6 +++++- .../files/lib/gluon/upgrade/radvd/invariant/10-radvd-user | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100755 package/gluon-radvd/files/lib/gluon/upgrade/radvd/invariant/10-radvd-user diff --git a/package/gluon-radvd/files/etc/init.d/gluon-radvd b/package/gluon-radvd/files/etc/init.d/gluon-radvd index 4064439b..2cfe0980 100755 --- a/package/gluon-radvd/files/etc/init.d/gluon-radvd +++ b/package/gluon-radvd/files/etc/init.d/gluon-radvd @@ -4,9 +4,13 @@ START=50 SERVICE_USE_PID=1 SERVICE_NAME=gluon-radvd +SERVICE_PID_DIR=/var/run/gluon-radvd +SERVICE_PID_FILE="$SERVICE_PID_DIR"/gluon-radvd.pid start() { - service_start /usr/sbin/radvd -C /lib/gluon/radvd/radvd.conf -m stderr_syslog -p /var/run/gluon-radvd.pid + mkdir -p "$SERVICE_PID_DIR" + chown gluon-radvd "$SERVICE_PID_DIR" + service_start /usr/sbin/radvd -C /lib/gluon/radvd/radvd.conf -m stderr_syslog -u gluon-radvd -p "$SERVICE_PID_FILE" } stop() { diff --git a/package/gluon-radvd/files/lib/gluon/upgrade/radvd/invariant/10-radvd-user b/package/gluon-radvd/files/lib/gluon/upgrade/radvd/invariant/10-radvd-user new file mode 100755 index 00000000..baa0c9d2 --- /dev/null +++ b/package/gluon-radvd/files/lib/gluon/upgrade/radvd/invariant/10-radvd-user @@ -0,0 +1,5 @@ +#!/bin/sh + +. /lib/gluon/functions/users.sh + +add_user gluon-radvd 801