root@4d0261d4eb42:/# sv stop apache2
ok: down: apache2: 0s, normally up
root@4d0261d4eb42:/# pstree
my_init─┬─apache2───5*[apache2]
├─runsvdir─┬─2*[runsv]
│ └─runsv───cron
└─syslog-ng
root@4d0261d4eb42:/# ps ax
PID TTY STAT TIME COMMAND
1 ? Ss 0:00 /usr/bin/python3 -u /sbin/my_init
12 ? S 0:00 /usr/sbin/syslog-ng --pidfile /var/run/syslog-ng.pid -F --no-caps
18 ? S 0:00 /usr/bin/runsvdir -P /etc/service
19 ? Ss 0:00 runsv sshd
20 ? Ss 0:00 runsv cron
21 ? Ss 0:00 runsv apache2
22 ? S 0:00 /usr/sbin/cron -f
25 ? S 0:00 /usr/sbin/apache2 -D FOREGROUND
26 ? S 0:00 /usr/sbin/apache2 -D FOREGROUND
27 ? S 0:00 /usr/sbin/apache2 -D FOREGROUND
28 ? S 0:00 /usr/sbin/apache2 -D FOREGROUND
29 ? S 0:00 /usr/sbin/apache2 -D FOREGROUND
30 ? S 0:00 /usr/sbin/apache2 -D FOREGROUND
31 pts/0 Ss 0:00 bash -l
51 pts/0 R+ 0:00 ps ax
From now on, the service becomes Schrodinger's server, it won't start yet it runs [run by my-init]:
root@4d0261d4eb42:/# sv start apache2
ok: run: apache2: (pid 59) 0s
root@4d0261d4eb42:/# pstree
my_init─┬─apache2───5*[apache2]
├─runsvdir─┬─2*[runsv]
│ └─runsv───cron
└─syslog-ng
root@4d0261d4eb42:/# ps ax
PID TTY STAT TIME COMMAND
1 ? Ss 0:00 /usr/bin/python3 -u /sbin/my_init
12 ? S 0:00 /usr/sbin/syslog-ng --pidfile /var/run/syslog-ng.pid -F --no-caps
18 ? S 0:00 /usr/bin/runsvdir -P /etc/service
19 ? Ss 0:00 runsv sshd
20 ? Ss 0:00 runsv cron
21 ? Ss 0:00 runsv apache2
22 ? S 0:00 /usr/sbin/cron -f
25 ? S 0:00 /usr/sbin/apache2 -D FOREGROUND
26 ? S 0:00 /usr/sbin/apache2 -D FOREGROUND
27 ? S 0:00 /usr/sbin/apache2 -D FOREGROUND
28 ? S 0:00 /usr/sbin/apache2 -D FOREGROUND
29 ? S 0:00 /usr/sbin/apache2 -D FOREGROUND
30 ? S 0:00 /usr/sbin/apache2 -D FOREGROUND
31 pts/0 Ss 0:00 bash -l
282 pts/0 R+ 0:00 ps ax
And the container is stuck in re-starting it [no wonder...]:
wuhu_1 | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 192.168.16.3. Set the 'ServerName' directive globally to suppress this message
wuhu_1 | httpd (pid 25) already running
What am I doing wrong here? Why is myinit reinstating the service in the first place?