packages/leafnode: move user/group creation from postinst to an initscript
git-svn-id: svn://svn.openwrt.org/openwrt/packages@28900 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
83e86898b7
commit
7cd0752226
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2009-2010 OpenWrt.org
|
||||
# Copyright (C) 2009-2011 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=leafnode
|
||||
PKG_VERSION:=1.11.8
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
||||
PKG_SOURCE_URL:=@SF/leafnode
|
||||
@ -63,12 +63,6 @@ define Package/leafnode/conffiles
|
||||
/etc/crontabs/news
|
||||
endef
|
||||
|
||||
define Package/leafnode/postinst
|
||||
#!/bin/sh
|
||||
grep -q '^news:' $${IPKG_INSTROOT}/etc/passwd 2>/dev/null
|
||||
[ $$? -ne 0 ] && echo "news:*:31:31:news:/var/spool/news:/bin/true" >>$${IPKG_INSTROOT}/etc/passwd && echo "news:x:31:" >>$${IPKG_INSTROOT}/etc/group || exit 0
|
||||
endef
|
||||
|
||||
define Package/leafnode/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/leafnode $(1)/usr/sbin/
|
||||
@ -80,6 +74,8 @@ define Package/leafnode/install
|
||||
$(INSTALL_DATA) ./files/nntp $(1)/etc/xinetd.d/
|
||||
$(INSTALL_DIR) $(1)/etc/crontabs
|
||||
$(INSTALL_DATA) ./files/news $(1)/etc/crontabs/
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/leafnode.init $(1)/etc/init.d/leafnode
|
||||
endef
|
||||
|
||||
define Package/leafnode-extra/install
|
||||
|
13
net/leafnode/files/leafnode.init
Normal file
13
net/leafnode/files/leafnode.init
Normal file
@ -0,0 +1,13 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2011 OpenWrt.org
|
||||
|
||||
START=49
|
||||
|
||||
start() {
|
||||
user_exists news 31 || user_add news 31 "" /var/spool/news
|
||||
group_exists news 31 || group_add news 31
|
||||
[ -d /var/spool/news ] || {
|
||||
mkdir -m 0755 -p /var/spool/news
|
||||
chown news:news /var/spool/news
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user