From d4042ec35eecb0d417af438a3cb80cc5b7d53ae7 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Wed, 8 Oct 2014 03:45:30 +0200 Subject: [PATCH] generic userid: use the new USERID api recent changes in trunk allow us to specify the userid inside the openwrt makefile. the info is stored int he meta data of the IPK contorl file and users are generated by the new generic postinst trigger. Signed-off-by: John Crispin --- admin/zabbix/Makefile | 1 + admin/zabbix/files/zabbix_agentd.init | 2 -- mail/dovecot/Makefile | 1 + mail/dovecot/files/dovecot.init | 2 -- net/dmapd/Makefile | 1 + net/dmapd/files/dmapd.init | 2 -- net/mosquitto/Makefile | 1 + net/mosquitto/files/mosquitto.init | 1 - net/ntpd/Makefile | 1 + net/ntpd/files/ntpd.init | 2 -- net/ocserv/Makefile | 1 + net/ocserv/files/ocserv.init | 3 --- net/openssh/Makefile | 1 + net/openssh/files/sshd.init | 2 -- net/portmap/Makefile | 1 + net/portmap/files/portmap.init | 3 --- net/prosody/Makefile | 1 + net/prosody/files/prosody.init | 2 -- net/tor/Makefile | 1 + net/tor/files/tor.init | 2 -- sound/pulseaudio/Makefile | 1 + sound/pulseaudio/files/pulseaudio.init | 2 -- 22 files changed, 11 insertions(+), 23 deletions(-) diff --git a/admin/zabbix/Makefile b/admin/zabbix/Makefile index 6d4d77965..1b8a97fb4 100644 --- a/admin/zabbix/Makefile +++ b/admin/zabbix/Makefile @@ -32,6 +32,7 @@ define Package/zabbix/Default URL:=http://www.zabbix.com/ SUBMENU:=zabbix MAINTAINER:=Etienne CHAMPETIER + USERID:=zabbix=53:zabbix=53 endef define Package/zabbix-agent diff --git a/admin/zabbix/files/zabbix_agentd.init b/admin/zabbix/files/zabbix_agentd.init index ed9acabb9..c806a9f0b 100644 --- a/admin/zabbix/files/zabbix_agentd.init +++ b/admin/zabbix/files/zabbix_agentd.init @@ -19,8 +19,6 @@ start() { } grep -q "^AllowRoot=1" ${CONFIG} || { - user_exists zabbix 53 || user_add zabbix 53 - group_exists zabbix 53 || group_add zabbix 53 touch ${SERVICE_PID_FILE} chown zabbix:zabbix ${SERVICE_PID_FILE} } diff --git a/mail/dovecot/Makefile b/mail/dovecot/Makefile index 27d28ac33..131ae7740 100644 --- a/mail/dovecot/Makefile +++ b/mail/dovecot/Makefile @@ -31,6 +31,7 @@ define Package/dovecot TITLE:=An IMAP and POP3 daemon MAINTAINER:=Peter Wagner URL:=http://www.dovecot.org/ + USERID:=dovecot=59:dovecot=59 endef define Package/dovecot/description diff --git a/mail/dovecot/files/dovecot.init b/mail/dovecot/files/dovecot.init index 7739cd15a..1f831842a 100644 --- a/mail/dovecot/files/dovecot.init +++ b/mail/dovecot/files/dovecot.init @@ -7,8 +7,6 @@ STOP=75 USE_PROCD=1 start_service() { - user_exists dovecot 59 || user_add dovecot 59 - group_exists dovecot 59 || group_add dovecot 59 mkdir -p -m 0755 /var/lib/dovecot mkdir -p -m 0755 /var/run/dovecot chmod 0750 /var/lib/dovecot diff --git a/net/dmapd/Makefile b/net/dmapd/Makefile index ca53f6bce..2c97879ac 100644 --- a/net/dmapd/Makefile +++ b/net/dmapd/Makefile @@ -32,6 +32,7 @@ define Package/dmapd DEPENDS:=+libdmapsharing +libdb47 +vips TITLE:= dmapd URL:=http://www.flyn.org/projects/dmapd/ + USERID:=dmapd=56:dmapd=56 endef define Package/dmapd/decription diff --git a/net/dmapd/files/dmapd.init b/net/dmapd/files/dmapd.init index 2d9e9aadf..76ecd501f 100644 --- a/net/dmapd/files/dmapd.init +++ b/net/dmapd/files/dmapd.init @@ -4,8 +4,6 @@ START=60 start() { - user_exists dmapd 56 || user_add dmapd 56 - group_exists dmapd 56 || group_add dmapd 56 [ -d /var/run/dmapd ] || { mkdir -m 0755 -p /var/run/dmapd chown dmapd:dmapd /var/run/dmapd diff --git a/net/mosquitto/Makefile b/net/mosquitto/Makefile index 586d31534..b252ac4cc 100644 --- a/net/mosquitto/Makefile +++ b/net/mosquitto/Makefile @@ -30,6 +30,7 @@ define Package/$(PKG_NAME)/default URL:=http://www.mosquitto.org/ MAINTAINER:=Karl Palsson DEPENDS:= +librt + USERID:=mosquitto=200:mosquitto=200 endef define Package/$(PKG_NAME) diff --git a/net/mosquitto/files/mosquitto.init b/net/mosquitto/files/mosquitto.init index aafa105ac..2b3a93a7f 100755 --- a/net/mosquitto/files/mosquitto.init +++ b/net/mosquitto/files/mosquitto.init @@ -14,7 +14,6 @@ SERVICE_DAEMONIZE=1 SERVICE_WRITE_PID=1 start() { - user_exists mosquitto 200 || user_add mosquitto 200 if [ "$USE_UCI_CONFIG" -eq 1 ]; then CONF=/tmp/mosquitto.converted.$$.conf mosquitto.uci.convert -f $CONF diff --git a/net/ntpd/Makefile b/net/ntpd/Makefile index 2b6496431..655902485 100644 --- a/net/ntpd/Makefile +++ b/net/ntpd/Makefile @@ -31,6 +31,7 @@ define Package/ntpd/Default MAINTAINER:=Peter Wagner URL:=http://www.ntp.org/ DEPENDS:=+libcap + USERID:=ntp=123:ntp=123 endef define Package/ntpd/Default/description diff --git a/net/ntpd/files/ntpd.init b/net/ntpd/files/ntpd.init index 05c317e95..e626e248f 100644 --- a/net/ntpd/files/ntpd.init +++ b/net/ntpd/files/ntpd.init @@ -9,8 +9,6 @@ USE_PROCD=1 start_service() { # ln -sf /dev/ttyS0 /dev/gps0 # /usr/sbin/setgarmin -d /dev/gps -c /etc/setgarmin.conf - user_exists ntp 123 || user_add ntp 123 123 ntp /var/lib/ntp - group_exists ntp 123 || group_add ntp 123 mkdir -p /var/lib/ntp chown -R ntp:ntp /var/lib/ntp diff --git a/net/ocserv/Makefile b/net/ocserv/Makefile index 42d9584ca..9a5bf2e46 100644 --- a/net/ocserv/Makefile +++ b/net/ocserv/Makefile @@ -34,6 +34,7 @@ define Package/ocserv URL:=http://www.infradead.org/ocserv/ MAINTAINER:=Nikos Mavrogiannopoulos DEPENDS:= +libgnutls +certtool +libncurses +libreadline +OCSERV_PAM:libpam +OCSERV_PROTOBUF:libprotobuf-c + USERID:=ocserv=72:ocserv=72 endef define Package/ocserv/description diff --git a/net/ocserv/files/ocserv.init b/net/ocserv/files/ocserv.init index 612262087..9fb9f1c45 100644 --- a/net/ocserv/files/ocserv.init +++ b/net/ocserv/files/ocserv.init @@ -86,9 +86,6 @@ setup_dns() { start() { local hostname iface - user_exists ocserv 72 || user_add ocserv 72 72 /var/lib/ocserv - group_exists ocserv 72 || group_add ocserv 72 - hostname=`uci get ddns.myddns.domain` [ -z "$hostname" ] && hostname=`uci get system.@system[0].hostname` diff --git a/net/openssh/Makefile b/net/openssh/Makefile index a635e07fe..f4f68bb03 100644 --- a/net/openssh/Makefile +++ b/net/openssh/Makefile @@ -35,6 +35,7 @@ define Package/openssh/Default URL:=http://www.openssh.com/ SUBMENU:=SSH VARIANT:=without-pam + USERID:=sshd=22:sshd=22 endef define Package/openssh-moduli diff --git a/net/openssh/files/sshd.init b/net/openssh/files/sshd.init index 879df12cd..c5a54e007 100644 --- a/net/openssh/files/sshd.init +++ b/net/openssh/files/sshd.init @@ -18,8 +18,6 @@ start_service() { } } }; done - user_exists sshd 22 || user_add sshd 22 22 sshd /var/empty - group_exists sshd 22 || group_add sshd 22 mkdir -m 0700 -p /var/empty procd_open_instance diff --git a/net/portmap/Makefile b/net/portmap/Makefile index 1f1858c85..03969f79d 100644 --- a/net/portmap/Makefile +++ b/net/portmap/Makefile @@ -29,6 +29,7 @@ define Package/portmap TITLE:=The RPC Portmapper URL:=http://neil.brown.name/portmap/ MAINTAINER:=Peter Wagner + USERID:=rpc=65533:rpc=65533 endef define Package/portmap/description diff --git a/net/portmap/files/portmap.init b/net/portmap/files/portmap.init index e3e27b7ed..621c313a0 100644 --- a/net/portmap/files/portmap.init +++ b/net/portmap/files/portmap.init @@ -7,9 +7,6 @@ STOP=19 USE_PROCD=1 start_service() { - user_exists rpc 65533 || user_add rpc 65533 65533 rpc /var/empty - group_exists rpc 65533 || group_add rpc 65533 - procd_open_instance procd_set_param command /usr/sbin/portmap -f procd_close_instance diff --git a/net/prosody/Makefile b/net/prosody/Makefile index 4ba1d6fec..985eb4c99 100644 --- a/net/prosody/Makefile +++ b/net/prosody/Makefile @@ -28,6 +28,7 @@ define Package/prosody DEPENDS:=+luafilesystem +libidn +luaexpat +luasec +libopenssl +libidn +liblua TITLE:=XMPP server URL:=http://prosody.im/ + USERID:=prosody=54:prosody=54 endef define Package/prosody/description diff --git a/net/prosody/files/prosody.init b/net/prosody/files/prosody.init index 9dd74f594..bab0ae7d5 100644 --- a/net/prosody/files/prosody.init +++ b/net/prosody/files/prosody.init @@ -14,8 +14,6 @@ RUN_USER=prosody RUN_GROUP=prosody start() { - user_exists prosody 54 || user_add prosody 54 - group_exists prosody 54 || group_add prosody 54 [ -d /var/run/prosody ] || { mkdir -m 0755 -p /var/run/prosody chown prosody:prosody /var/run/prosody diff --git a/net/tor/Makefile b/net/tor/Makefile index ae01d8949..98fda865b 100644 --- a/net/tor/Makefile +++ b/net/tor/Makefile @@ -27,6 +27,7 @@ define Package/tor/Default SECTION:=net CATEGORY:=Network URL:=https://www.torproject.org/ + USERID:=tor=52:tor=52 endef define Package/tor/Default/description diff --git a/net/tor/files/tor.init b/net/tor/files/tor.init index 7c548b40b..6974057d4 100644 --- a/net/tor/files/tor.init +++ b/net/tor/files/tor.init @@ -7,8 +7,6 @@ STOP=50 USE_PROCD=1 start_service() { - user_exists tor 52 || user_add tor 52 52 /var/lib/tor - group_exists tor 52 || group_add tor 52 [ -f /var/run/tor.pid ] || { touch /var/run/tor.pid chown tor:tor /var/run/tor.pid diff --git a/sound/pulseaudio/Makefile b/sound/pulseaudio/Makefile index cfcb61c23..e1d97e7c8 100644 --- a/sound/pulseaudio/Makefile +++ b/sound/pulseaudio/Makefile @@ -38,6 +38,7 @@ define Package/pulseaudio/Default MAINTAINER:=Peter Wagner URL:=http://www.pulseaudio.org PROVIDES:=pulseaudio + USERID:=pulse=51:pulse=51 endef define Package/pulseaudio-daemon diff --git a/sound/pulseaudio/files/pulseaudio.init b/sound/pulseaudio/files/pulseaudio.init index 336f3716a..1262b941e 100644 --- a/sound/pulseaudio/files/pulseaudio.init +++ b/sound/pulseaudio/files/pulseaudio.init @@ -8,8 +8,6 @@ USE_PROCD=1 PROG=/usr/bin/pulseaudio start_service() { - user_exists pulse 51 || user_add pulse 51 - group_exists pulse 51 || group_add pulse 51 [ -d /var/run/pulse ] || { mkdir -m 0755 -p /var/run/pulse chmod 0750 /var/run/pulse