Commit 0c6df01a authored by The Heavy's avatar The Heavy 🚂
Browse files

Add SysV init helpers

parent d95e9ba3
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ After signing in you should run 'Re-check and refresh configuration' (should be
- The Webmin certificate is generated during image build, this means all containers share the same default certificate which is bad for security.
- The DKIM selector and private key need randomising.
- Upgrading Webmin within the container fails, need to disable the upgrades somehow?
- Some SysV init scripts have been replaced with 'no-ops' because we don't have an S6 service for them yet, others are hacky links to the S6 equivalents for SysV very rudimentary SysV init compatibility.

## Licence

+1 −0
Original line number Diff line number Diff line
@@ -70,6 +70,7 @@ chown -R opendkim:opendkim /etc/dkimkeys /run/opendkim
chown -R clamav:clamav /var/lib/clamav
chown -R mysql:root /var/run/mysqld
chmod -R go-w /etc/postfix
chmod -R a+x /etc/init.d

# find the container's IP address (no doubt there are some containers that break this as we assume eth0 is the network device)
MY_IP=$(ip addr show dev eth0 | grep -Eo 'inet (.*)/' | sed -e 's#inet ##' -e 's#/##')
+15 −0
Original line number Diff line number Diff line
#!/bin/sh
### BEGIN INIT INFO
# Provides:          apache-htcacheclean
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Cache cleaner process for Apache2 web server
# Description:       Start the htcacheclean helper
#  This script will start htcacheclean which will periodically scan the
#  cache directory of Apache2's mod_cache_disk and remove outdated files.
### END INIT INFO

echo "This service is currently a no-op"
exit 0
+42 −0
Original line number Diff line number Diff line
#!/bin/sh
### BEGIN INIT INFO
# Provides:          apache2
# Required-Start:    $local_fs $remote_fs $network $syslog $named
# Required-Stop:     $local_fs $remote_fs $network $syslog $named
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# X-Interactive:     true
# Short-Description: Apache2 web server
# Description:       Start the web server
#  This script will start the apache2 web server.
### END INIT INFO

case "$1" in
  start)
        /usr/bin/s6-svc -uwR /var/run/s6/services/apache2
        ;;
  stop)
        /usr/bin/s6-svc -dwD /var/run/s6/services/apache2
        ;;
  graceful-stop)
        /usr/bin/s6-svc -yO /var/run/s6/services/apache2
        ;;
  status)
        /usr/bin/s6-svstat /var/run/s6/services/apache2
        ;;
  reload|force-reload|graceful)
        /usr/bin/s6-svc -1 /var/run/s6/services/apache2
        ;;
  restart)
        /usr/bin/s6-svc -ruwR /var/run/s6/services/apache2
        ;;
  start-htcacheclean|stop-htcacheclean)
        echo "Use 'service apache-htcacheclean' instead"
        ;;
  *)
        echo "Usage: apache2 {start|stop|graceful-stop|restart|reload|force-reload}" >&2
        exit 3
        ;;
esac

exit 0
+15 −0
Original line number Diff line number Diff line
#!/bin/sh
### BEGIN INIT INFO
# Provides:          clamav-freshclam
# Required-Start:    $remote_fs $syslog
# Should-Start:      clamav-daemon
# Required-Stop:     $remote_fs $syslog
# Should-Stop:       
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: ClamAV virus database updater
# Description:       Clam AntiVirus virus database updater
### END INIT INFO

echo "This service is currently a no-op"
exit 0
Loading