diff options
author | lme <lme@FreeBSD.org> | 2013-05-11 03:11:11 +0800 |
---|---|---|
committer | lme <lme@FreeBSD.org> | 2013-05-11 03:11:11 +0800 |
commit | 0ccad752ad4bfe549b9737f53ecb85e058482758 (patch) | |
tree | 922ae8ead14274c26bb55650275b192bf02a6a01 | |
parent | 93e81f49de51d30e64a13826c52a672660f66eeb (diff) | |
download | freebsd-ports-gnome-0ccad752ad4bfe549b9737f53ecb85e058482758.tar.gz freebsd-ports-gnome-0ccad752ad4bfe549b9737f53ecb85e058482758.tar.zst freebsd-ports-gnome-0ccad752ad4bfe549b9737f53ecb85e058482758.zip |
- Change rc script, so netdisco is not run as root
- Fix group replacement in rc script
- Trim Makefile header
PR: ports/177632
Submitted by: maintainer
-rw-r--r-- | net-mgmt/netdisco/Makefile | 6 | ||||
-rw-r--r-- | net-mgmt/netdisco/files/netdisco.in | 20 |
2 files changed, 10 insertions, 16 deletions
diff --git a/net-mgmt/netdisco/Makefile b/net-mgmt/netdisco/Makefile index c0d7d113dadc..e2c6ce5e80c9 100644 --- a/net-mgmt/netdisco/Makefile +++ b/net-mgmt/netdisco/Makefile @@ -1,9 +1,5 @@ -# New ports collection makefile for: netdisco -# Date created: 2006-04-08 -# Whom: Shaun Amott <shaun@inerd.com> -# +# Created by: Shaun Amott <shaun@inerd.com> # $FreeBSD$ -# PORTNAME= netdisco PORTVERSION= 1.1 diff --git a/net-mgmt/netdisco/files/netdisco.in b/net-mgmt/netdisco/files/netdisco.in index 44d193e86178..84da57b2b6dd 100644 --- a/net-mgmt/netdisco/files/netdisco.in +++ b/net-mgmt/netdisco/files/netdisco.in @@ -18,36 +18,34 @@ load_rc_config $name : ${netdisco_group="%%NETDISCO_GROUP%%"} start_precmd=${name}_prestart -start_cmd=${name}_start stop_cmd=${name}_stop restart_cmd=${name}_restart status_cmd=${name}_status command="%%PREFIX%%/bin/netdisco" command_interpreter="/usr/bin/perl" -pidfile=%%NETDISCO_RUNDIR%%/netdisco_daemon.pid +netdisco_config="%%ETCDIR%%/netdisco.conf" +pidfile=$(grep ^daemon_pid $netdisco_config | sed -E 's/.*=\s+//') +flags="-p start" -required_files="%%ETCDIR%%/netdisco.conf" +required_files="$netdisco_config" netdisco_prestart() { - test -d %%NETDISCO_RUNDIR%% || install -d -m 0700 -o $netdisco_user -g $netdisco_group %%NETDISCO_RUNDIR%% + test -d ${pidfile%/*} || install -d -m 0700 -o $netdisco_user -g $netdisco_group ${pidfile%/*} + touch $pidfile && chown $netdisco_user $pidfile test -d %%NETDISCO_DBDIR%% || install -d -m 0700 -o $netdisco_user -g $netdisco_group %%NETDISCO_DBDIR%% } -netdisco_start() { - $command -p start -} - netdisco_stop() { - $command -p stop + su -m "$netdisco_user" -c "$command -p stop" } netdisco_restart() { - $command -p restart + su -m "$netdisco_user" -c "$command -p restart" } netdisco_status() { - $command -p status + su -m "$netdisco_user" -c "$command -p status" } run_rc_command "$1" |