Skip to content

Commit

Permalink
Only run the chkconfig and service commands on install and uninstall
Browse files Browse the repository at this point in the history
(not updates)
  • Loading branch information
jeffsheltren committed Sep 14, 2012
1 parent 319bcd9 commit 5d59d3d
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions utils/centos/twisted-drupalGitSSHDaemon.spec
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ BuildArch: noarch
Requires: python26-twisted
Requires(post): /sbin/chkconfig, openssh
Requires(preun): /sbin/chkconfig, /sbin/service
Requires(postun): /sbin/service

%description
Patched from the "automatically created by tap2rpm" rpm
Expand All @@ -37,14 +36,18 @@ cp "twisted-drupalGitSSHDaemon.init" "$RPM_BUILD_ROOT"/etc/init.d/"twisted-drupa
[ ! -z "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != '/' ] && rm -rf "$RPM_BUILD_ROOT"

%post
/usr/bin/ssh-keygen -t rsa -f /etc/twisted-keys/default -P ""
/sbin/chkconfig --add twisted-drupalGitSSHDaemon
/sbin/chkconfig --level 35 twisted-drupalGitSSHDaemon
/sbin/service twisted-drupalGitSSHDaemon start
if [ $1 -eq 1 ]; then
/usr/bin/ssh-keygen -t rsa -f /etc/twisted-keys/default -P ""
/sbin/chkconfig --add twisted-drupalGitSSHDaemon
/sbin/chkconfig --level 35 twisted-drupalGitSSHDaemon
/sbin/service twisted-drupalGitSSHDaemon start
fi

%preun
/sbin/service twisted-drupalGitSSHDaemon stop
/sbin/chkconfig --del twisted-drupalGitSSHDaemon
if [ $1 -eq 0 ]; then
/sbin/service twisted-drupalGitSSHDaemon stop
/sbin/chkconfig --del twisted-drupalGitSSHDaemon
fi

%files
%defattr(-,root,root)
Expand Down

0 comments on commit 5d59d3d

Please sign in to comment.