I am goi g to focus on the s6-rc init system in Devuan 5
Lets try to do something. First get it up to date
apt-get update
OK
apt-get upgrade
root@init-diversity:/home/nevj# apt-get upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
grub-pc : Depends: grub-common (= 2.06-13) but 2.06-13+deb12u1 is installed
Depends: grub2-common (= 2.06-13) but 2.06-13+deb12u1 is installed
Depends: grub-pc-bin (= 2.06-13) but 2.06-13+deb12u1 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
So it does not quite have its package setup right
apt --fix-broken install
it works
But there is a complaint about grub
which I ignore, and it goes ahead and install grub on /dev/vda, and all is OK. I tested a reboot… the multi-init-grub-screen is still there.
Now let us see if we can install a new service
root@init-diversity:/home/nevj# apt-get install vsftpd
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
vsftpd
0 upgraded, 1 newly installed, 0 to remove and 26 not upgraded.
Need to get 142 kB of archives.
After this operation, 351 kB of additional disk space will be used.
Get:1 http://deb.devuan.org/merged daedalus/main amd64 vsftpd amd64 3.0.3-13+b2 [142 kB]
Fetched 142 kB in 3s (56.2 kB/s)
Preconfiguring packages ...
Selecting previously unselected package vsftpd.
(Reading database ... 279933 files and directories currently installed.)
Preparing to unpack .../vsftpd_3.0.3-13+b2_amd64.deb ...
Unpacking vsftpd (3.0.3-13+b2) ...
Setting up vsftpd (3.0.3-13+b2) ...
invoke-rc.d: could not determine current runlevel
Processing triggers for man-db (2.11.2-2) ...
Well it did something. Lets look and see what is there
nevj@init-diversity:~$ ps ax | grep vsftpd
5950 pts/0 S+ 0:00 grep vsftpd
No it is not running
What is in /etc?
nevj@init-diversity:/etc/init.d$ cat vsftpd
#!/bin/sh
### BEGIN INIT INFO
# Provides: vsftpd
# Required-Start: $network $remote_fs $syslog
# Required-Stop: $network $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Very secure FTP server
# Description: Provides a lightweight, efficient FTP server written
# for security.
### END INIT INFO
...............
echo "Usage: ${0} {start|stop|restart|reload|status}"
exit 1
;;
esac
That is a sysVinit script for vsftpd.
That is what Devuan normally does - its package system installs sysVinit scripts for services.
Is there anything else?
There is no vsftpd
directory in /etc/s6-rc/sv
So I am on my own… have to write an s6-rc script.
Never written one… have no instructions… lets try copying one and modifying it.
oot@init-diversity:/etc/s6-rc/sv# mkdir vsftfd-srv
root@init-diversity:/etc/s6-rc/sv# cd vsftfd-srv
root@init-diversity:/etc/s6-rc/sv/vsftfd-srv# cp -r ../sshd-srv/* .
root@init-diversity:/etc/s6-rc/sv/vsftfd-srv# ls
producer-for run type
type
is OK , it is longrun
producer-for
contains sshd-log… we dont want a log …we will empty it
run
needs editing
#!/bin/execlineb -P
##if -t { test -s /etc/vsftp/vsftpd_not_to_be_run } exit 161
foreground { mkdir -p /run/vsftpd }
foreground { chmod 0755 /run/vsftpd }
foreground { redirfd -w 1 /dev/null ssh-keygen -A }
foreground { touch /var/log/lastlog }
foreground { chgrp utmp /var/log/lastlog }
foreground { chmod 664 /var/log/lastlog }
envfile /etc/s6-rc/config/vsftpd.conf
importas -sCuD "" OPTS OPTS
fdmove -c 2 1
exec /usr/sbin/vsftpd ${OPTS}
There a a few guesses in there.
Reboot, and it is still not running.
OK, still learning… S6 is not as easy as runit… maybe that run script needs to be somewhere else ( like current or whatever) … maybe I need a link like in runit??
First lets see if I can start it by hand ( it did not start at boot).
root@init-diversity:/run/s6-rc/servicedirs# s6-rc -u change vsftpd-srv
s6-rc: fatal: vsftpd-srv is not a recognized identifier in /run/s6-rc/resolve.cdb
So there is more to it than that.
I fear that putting a directory in /etc/s6-rc/sv is not enough… I need it in
what S6 calls the scan directory
, which is /run/service
. In there are a whole lot of links to files in /run/s6-rc/servicedirs/
ie the scan directory is a link-farm
.
So I will try putting a copy of the vsftpd-srv
directory in /run/s6-rc/servicedirs/
and make a link from /run/service
cp -r /etc/s6-rc/sv/vsftpd-srv /run/s6-rc/servicedirs
ln -s /run/s6-rc/servicedirs/vsftpd-srv /run/service/vsftpd-srv
reboot , and it is still not running
Try to start it now
root@init-diversity:/home/nevj# s6-rc -u change vsftpd-srv
s6-rc: fatal: vsftpd-srv is not a recognized identifier in /run/s6-rc/resolve.cdb
So it still fails and same message.
I think I need to do something about compiling the s6 database
Will close this now
Try again tomorrow