Devuan5 init diversity edition

It is in Applications → Settings → s6-rc-service-manager
devuaninitdivs6rcservicemanager

That is the default . If we scroll it down
devuaninitdivservicemanager2
we see all the services that are not locked, starting with bluetoothd-log.
These are theones that are in the antix-service-manager bundle

nevj@init-diversity:~$ s6-rc list antix-service-manager
NetworkManager-log
NetworkManager-srv
bluetoothd-log
bluetoothd-srv
connmand-log
connmand-srv
dbus-log
dbus-srv
elogind
lightdm-log
lightdm-srv
pulseaudio-log
pulseaudio-srv
seatd
sshd-log
sshd-srv
tty3
tty4
tty5
tty6
udevd-log
xrdp-log
xrdp-sesman-log
xrdp-sesman-srv
xrdp-srv
ufw

We see that the new service I installed vsftpd is not there
I need to add it to this bundle

“If you have created the source script, you could just use the GUI to add it to the “antix-service-manager” bundle which is already part of the “Default” bundle.”

So lets try it, I bring up the service manager GUI, and hit add, and get


and there it is, it is offering my vsftpd-srv service. ( that is because I have made a source script for vsftpd)
I click on vsftpd-srv , then add , and it appears at the bottom of the list
devuaninitdivvsftpdstart

I click start and it does not start… the window stays the same… no tick on vsftpd-srv.

So failure, I have to investigate. Most likely my guesswork source script is wrong.

What is really impressive is the GUI Service Manager. It is the same as the one in Antix. I have used it before in normal Antix ( with sysVinit) and it works brilliantly there. The problems here are with s6, not the GUI.

2 Likes

Got it working

3 Likes

Thanks, I tried the script in Artix Linux Gitea.
It does not work as is.
But it seems your 1 line modification is a fix.
Will try to follow your success.
Then.
I want to delete it, and see if I can do it by hand, without the GUI help.
S6 is a bigger learning curve than runit.

3 Likes

I’d just copy an existing service’s folders & config file (eg acpid-srv & acpid-log & acpid.conf) to use as a template & modify to suit the new service I want to run

That is very true for s6-rc.
s6-66 is quite comparable to runit, the operator needs to only maintain a single frontend file & get familiar with the relevant cli commands.

3 Likes

This is the s6-rc run script devised by @ProwlerGr

#!/bin/execlineb -P
fdmove -c 2 1
exec vsftpd -obackground=no

The script uses execlineb rather than a shell because execlineb parses the following script lines and makes appropriate entries in the s6-rc compiled database.
The ‘fdmove’ command is a special skarnet command which switches the file descriptors of stdout and stderr.
The exec command is always used in scripts to start daemons, because we want them to be orphaned ( ie not run in a parent shell).

To use this run script we put it in /etc/s6-rc/sv/vsftpd-srv in a file called run. There is also a file called type in that directory… it should contain
the word longrun.
In setting this up I discovered
“A regular file named type, that contains only the text oneshot, longrun or bundle, and a terminating newline”
I had omitted the terminating newline… that may have contributed to my failure.
s6-rc has 3 types of service

  • longrun normal daemons that run continuously
  • oneshot services that do something then die
  • bundle group of services managed with one command

Lets try again , with just this script and no logging
So fire up the s6-rc service manager GUI, tell it to start vsftpd-srv. and …
it does not start.
So maybe it has to have the logging, or the vsftpd.conf file

So, back to /etc/s6-rc, setup the log run file and vsftpd.conf
Retry with the s6-service-manager GUI
Add both vsftpd-srv and vsftpd-log
Neither of them will start
It still gives the message “Not LongRun” ???
servicemanager2

At this stage I am feeleing that I must have to do something in addition to putting those files in /etc/s6-rc/…

I decide to try the script s6-db-reload and it says

root@init-diversity:~# s6-db-reload
s6-rc-compile: fatal: unable to read /etc/s6-rc/sv/vsftpd-log/type: No such file or directory
s6-rc-update: fatal: unable to take lock on /etc/s6-rc/compiled: No such file or directory
s6-rc database has been updated
Do you want to reload the new default service state? [Y/n] ^C

So it looks like there are some permission problems .
I stopped the script at that point.
I will look into that.

Result:
THe first message is solved… I forgot to make a 'type` file in /etc/s6-rc/vsftpd-log

The second message is serious:

root@init-diversity:/etc/s6-rc# ls
compiled				 helper-scripts		s6-rc-init
compiled-release			 log-service-reload.sh	sv
compiled-superseded-1713871820450068219  rc.local		sv-release
config					 s6-db-reload.conf
current					 s6-db-reload.sh
root@init-diversity:/etc/s6-rc# ls -l compiled
lrwxrwxrwx 1 root root 26 Apr 23 11:30 compiled -> /etc/s6-rc/compiled-active

compiled is a pointer to compiled-active in /etc/s6-rc and compiled-active does not exist ???

Not sure what to do about that. Perhaps it is just a consequence of the previous error.

2 Likes

Re-run the s6-db-compile command, it will recreate the folder (after a succesfull compile)

Alternatively rename the superseded folder back to active (reinstating the link)

2 Likes

Well I need that more desperately now. After a shutdown, the s6-rc grub entry would not boot… it gave a helpful message

s6-rc-init: unable to open /etc/s6-rc/compiled : no such file or directory.

This is like a game of snakes and ladders… I have just been gobbled by a snake and I need your ladder to acscend again, so

cd /etc/s6-rc
cp -r compiled-superseded-1713871820450068219 compiled-active
ln -s /etc/s6-rc/compiled-active compiled

then reboot, and boot s6-rc
magic… it boots now.

Back to the problem.
The s6-rc service manager gui still will not start vsftpd-srv, and it still says “Status: not Longrun”

So try the s6-db-reload script again

root@init-diversity:/home/nevj# s6-rc-reload
bash: s6-rc-reload: command not found
root@init-diversity:/home/nevj# s6-db-reload
s6-rc database has been updated
Do you want to reload the new default service state? [Y/n] y
reloading default bundle
sh: 0: cannot open /etc/s6-rc/helper-scripts/mount-bootclean/mount-bootclean.sh: No such file
s6-rc: warning: unable to start service mount-bootclean: command exited 2
Starting fake hwclock: loading system time.
/etc/s6-rc/helper-scripts/fake-hwclock/shell_up: 10: fake-hwclock: not found
s6-rc: warning: unable to start service fake-hwclock: command exited 127
default bundle has been reloaded
Dou you want to delete old service databases? [Y/n] n
Not deleting old service databases
root@init-diversity:/home/nevj# exit
exit

Now is anything running?

nevj@init-diversity:~$ ps ax | grep ftp
 9997 ?        S      0:00 s6-supervise vsftpd-srv
 9998 ?        S      0:00 s6-supervise vsftpd-log
12647 pts/0    S+     0:00 grep ftp

Yes, there are two supervise daemons, one for vsftpd-srv and one for vsftpd-log… but no vsftpd daemon

So I think now I need to start it using the GUI
s6-rcguidown

Ah, that looks better, it now says “Status:Down” ( instead on not Longrun)
Now try to start it
Nothing happens … it stays Down on the GUI and there is no daemon running.

That may be because root does not have /sbin in its PATH… ie it cant find vsftpd… which vsftpd fails but the file is there in /sbin.
So, fix the PATH

Reboot, and which vsftpd now works.
But the GUI still does not start vsftpd-srv… it stays Down.

I can start vsftpd by hand

root@init-diversity:/home/nevj/Desktop# vsftpd &
[1] 8874

root@init-diversity:/home/nevj/Desktop# ps ax | grep ftp
  348 ?        S      0:00 s6-supervise vsftpd-srv
  389 ?        S      0:00 s6-supervise vsftpd-log
 8874 pts/0    S      0:00 vsftpd
 8997 pts/0    S+     0:00 grep ftp

There it is, process 8874.
So there is nothing wrong with vsftpd itself. The run script must be wrong.

Last ditch try …use the CLI instead of GUI ( kill vsftpd first)

root@init-diversity:/home/nevj# s6-rc -u change vsftpd-srv
root@init-diversity:/home/nevj# ps ax | grep ftp
  348 ?        S      0:00 s6-supervise vsftpd-srv
  389 ?        S      0:00 s6-supervise vsftpd-log
21925 pts/0    S+     0:00 grep ftp

No it will not start from a CLI command either, and there is no message. So the problem is not the GUI, it must be the run script.

2 Likes

Can you test against cli commands
s6-rc -ua list #Shows up services
s6-rc -da list #Shows down services

2 Likes

Will do tomorrow.
I am thinking this may be a Devuan issue… you developed that script in Antix

Here is a nice article from Linux Format about init systems.

It looks like you can’t read the whole thing there. Here is another link where you could try one month of the magazine for free.

3 Likes
$ s6-rc -ua list | column
s6rc-oneshot-runner	syslog-ng-srv		cryptsetup
s6rc-fdholder		tty2			hostname
NetworkManager-log	tty3			kmod-static-nodes
NetworkManager-srv	tty4			modules
bluetoothd-log		tty5			mount-cgroups
bluetoothd-srv		tty6			mount-configfs
connmand-log		ubus-log		mount-procfs
connmand-srv		ubus-srv		mountall
dbus-log		udevd-log		mountdevsubfs
dbus-srv		udevd-srv		mountkernfs
elogind			vsftpd-log		mountnfs
lightdm-log		vsftpd-srv		net-lo
lightdm-srv		xrdp-log		remount-root
pulseaudio-log		xrdp-sesman-log		udevadm
pulseaudio-srv		xrdp-sesman-srv		ufw
seatd			xrdp-srv		urandom
sshd-log		binfmt			x11-common
sshd-srv		bootmisc
syslog-ng-log		brightness
$ s6-rc -da list | column
acpid-log		sddm-log		wpa_supplicant-log
acpid-srv		sddm-srv		wpa_supplicant-srv
dhcpcd-log		slim-log		alsa
dhcpcd-srv		slim-srv		fake-hwclock
dmeventd-log		slimski-log		hwclock
dmeventd-srv		slimski-srv		keyboard-setup
haveged-log		smbd-log		mount-bootclean
haveged-srv		smbd-srv		mountnfs-bootclean
lxdm-log		snetaid-log		swap
lxdm-srv		snetaid-srv		sysctl
nmbd-log		usbmount-log		sysusers
nmbd-srv		usbmount-srv

vsftpd-srv and -log are in the ‘up’ list
but
the service manager has htem ticked, but says Status:down
servicemanager2

When I hit start, the status stays at ‘Down’

# s6-rc -v 4 start vsftpd-srv
s6-rc: info: bringing selected services up
s6-rc: info: service vsftpd-srv: already up

So the service manager has a different view of vsftpd-srv status
than what the s6-rc command has ?

It uses 2 options. The box & tick shows that s6-rc (service manager) reports the service as up.
The status text shows status reported by s6-svstat (service supervisor).

# s6-svstat vsftpd-srv
s6-svstat: fatal: unable to read status for vsftpd-srv: s6-supervise not running
# ps ax | grep ftp
  354 ?        S      0:00 s6-supervise vsftpd-srv
  395 ?        S      0:00 s6-supervise vsftpd-log

It reports that s6-supervise is not running… but it seems to be running when I look with ps ?

This is crazy. I think I will start again with a new install of Devuan… or maybe try Antix instead.

It works in Artix

# s6-rc start vsftpd
# ps ax | grep ftp
  308 ?        S      0:00 s6-supervise vsftpd-ipv6
  319 ?        S      0:00 s6-supervise vsftpd
 5037 ?        Ss     0:00 vsftpd -obackground=no

but Artix still has this issue

# s6-svstat vsftpd
s6-svstat: fatal: unable to read status for vsftpd: s6-supervise not running

Seems like s6-svstat has problems, both is Artix and in Devuan?

The command should be like:

s6-svstat /run/s6-rc/scandir/vsftpd-srv

2 Likes

In Artix

# s6-svstat /run/s6-rc/scandir/vsftpd
up (pid 5037) 1001 seconds

OK that works. I shall go back to Devuan.

1 Like

Back in Devuan

# s6-svstat /run/s6-rc/scandir/vsftpd-srv
down (exitcode 127) 0 seconds, normally up, want up, ready 0 seconds

I have to look up exitcode 127.
I read somewhere that if s6 fails to do an ‘up’ it sets the status to ‘down’ … it needs a ‘failed-up’ status.

" Value 127 is returned by /bin/sh when the given command is not found within your PATH system variable and it is not a built-in shell command …"
So there is still a ‘command not found’ problem.

I fixed root’s PATH. Maybe I need to fix the users PATH too?

root@init-diversity:/home/nevj# echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/sbin:/usr/sbin:/usr/local/sbin
root@init-diversity:/home/nevj# which vsftpd
/sbin/vsftpd
1 Like

No that makes no difference.
I wonder which command it can not find?

#which fdmove
returns nothing

So it cant find fdmove… I thought that came from skarnet?
It cant find execline either.
Some package is missing

I doubt that is the case, it is vsftpd that you seem to be having problems with, all other services (and there is many of them) work as expected out-of-the-box. I’ll have a look with a fresh devuan virtualbox install & see if I get the same problem as yourself with vsftpd.

I had it working with one of my previous installs as per screenshot.

3 Likes

Was that Devuan?
Check /bin/execlineb
it may be somewhere else in Devuan

Just tested using the live iso (installing vsftpd & manually created s6-rc service files), & getting the same result as you (for vsftpd).

Need to research why this fails - tweaks to the service file may be needed…

3 Likes