vmware-archive / salt-pack

Salt Package Builder
Apache License 2.0
55 stars 23 forks source link

EL6 packages do not add service to chkconfig, or remove it on uninstall #707

Closed terminalmage closed 1 year ago

terminalmage commented 4 years ago

The %post section needs to do a /sbin/chkconfig --add service-name, otherwise you get a lot of this in the logs after installing Salt, when you apply a service.running state for the master, minion, syndic, etc.:

[ERROR   ] Command '[u'/sbin/chkconfig', u'--list', u'salt-master']' failed with return code: 1
[ERROR   ] stderr: service salt-master supports chkconfig, but is not referenced in any runlevel (run 'chkconfig --add salt-master')

Similarly, the %preun should be removing the service from chkconfig when the uninstall is not due to an upgrade, but it is not:

if [ $1 -eq 0 ] ; then
  /sbin/service service_name stop >/dev/null 2>&1
  /sbin/chkconfig --del service_name
fi
terminalmage commented 1 year ago

Closing since el6 is no longer supported.