]> git.pld-linux.org Git - packages/ntop.git/commitdiff
- add GID / UID == 120
authorpbern <pbern@pld-linux.org>
Sat, 25 Oct 2003 20:04:02 +0000 (20:04 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    ntop.spec -> 1.44

ntop.spec

index ea8fe11d0abf23cc4b613a71a265e650ed51b1bc..338ca307242be0f76d0f38dddf57e36ec2cd0317 100644 (file)
--- a/ntop.spec
+++ b/ntop.spec
@@ -96,8 +96,42 @@ install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/ntop
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%post   -p /sbin/ldconfig
-%postun -p /sbin/ldconfig
+%pre
+if [ -n "`getgid ntop`" ]; then
+        if [ "`getgid ntop`" != "120" ]; then
+                echo "Error: group ntop doesn't have gid=120. Correct this before installing ntop." 1>&2
+                exit 1
+        fi
+else
+        /usr/sbin/groupadd -g 120 -r -f ntop
+fi
+if [ -n "`id -u ntop 2>/dev/null`" ]; then
+        if [ "`id -u ntop`" != "120" ]; then
+                echo "Error: user ntop doesn't have uid=120. Correct this before installing ntop." 1>&2
+                exit 1
+        fi
+else
+        /usr/sbin/useradd -u 120 -r -d /var/lib/ntop -s /bin/false -c "ntop User" -g ntop ntop 1>&2
+fi
+
+%post   
+/sbin/ldconfig
+/sbin/chkconfig --add ntop
+
+%preun
+if [ "$1" = "0" ]; then
+        if [ -f /var/lock/subsys/ntop ]; then
+                /etc/rc.d/init.d/ntop stop 1>&2
+        fi
+        /sbin/chkconfig --del ntop
+fi
+
+%postun 
+/sbin/ldconfig
+if [ "$1" = "0" ]; then
+        /usr/sbin/userdel ntop
+        /usr/sbin/groupdel ntop
+fi
 
 %files
 %defattr(644,root,root,755)
This page took 0.149024 seconds and 4 git commands to generate.