S6 init system with s6-66 service manager in Antix-init-diversity spin

When I enable rpc.mountd service in nfsserver-tree, it seems to shift the rpcbind service, on which it depends, out of nfs-tree into
nfsserver-tree?

root@antix-init-diversity:/etc/66/service# 66 tree status
Name        : boot
Current     : no
Enabled     : no
Allowed     : root
Groups      : boot
Depends     : None
Required by : None
Contents    : boot@system:mount-run boot@system:system-hostname
              boot@system:populate-run boot@system:mount-tmp
              boot@system:populate-tmp boot@system:populate-sys
              boot@system:mount-pts boot@system:mount-shm
              boot@system:populate-dev boot@system:mount-cgroups
              boot@system:mount-branch boot@system:system-hwclock
              boot@system:modules-kernel boot@system:system-random
              boot@system:system-sysctl boot@system:udevd-log
              boot@system:udevd boot@system:udevadm
              boot@system:system-fontnkey boot@system:system-fsck
              boot@system:system-branch boot@system:mount-rw
              boot@system:mount-swap boot@system:local-time
              boot@system:local-loop boot@system:local-sethostname
              boot@system:local-authfiles boot@system:local-rc
              boot@system:local-dmesg boot@system:local-branch
              boot@system:runtime-branch boot@system:canopy
              boot@system:tty-rc@tty1 boot@system:tty-earlier@tty12
              boot@system:tty-rc@tty2 boot@system

Name        : nfs-tree
Current     : no
Enabled     : no
Allowed     : root
Groups      : admin
Depends     : None
Required by : nfsclient-tree nfsserver-tree
Contents    : rpcbind rpcbind-log

Name        : global
Current     : no
Enabled     : yes
Allowed     : root
Groups      : admin
Depends     : None
Required by : None
Contents    : dbus-log dbus seatd-log seatd slimski-log slimski
              connmand-log connmand nmbd-log nmbd smbd-log smbd ufw
              bluetoothd-log bluetoothd sshd-log sshd elogind-log elogind
              vsftpd-log vsftpd spice-vdagentd-log spice-vdagentd
              spice-vdagent-log spice-vdagent xeyes-log xeyes
              avahi-daemon-log avahi-daemon

Name        : nfsclient-tree
Current     : no
Enabled     : no
Allowed     : root
Groups      : admin
Depends     : nfs-tree
Required by : None
Contents    : rpc.statd-log rpc.statd rpc.idmapd-log rpc.idmapd
              rpc.gssd-log rpc.gssd

Name        : nfsserver-tree
Current     : no
Enabled     : no
Allowed     : root
Groups      : admin
Depends     : nfs-tree
Required by : None
Contents    : rpc.mountd-log rpc.mountd rpc.nfsd-log rpc.nfsd

root@antix-init-diversity:/etc/66/service# 66 -t nfsserver-tree enable rpc.mountd
enable: info: Enabled successfully: rpcbind-log
enable: info: Enabled successfully: rpcbind
enable: info: Enabled successfully: rpc.mountd-log
enable: info: Enabled successfully: rpc.mountd
root@antix-init-diversity:/etc/66/service# 66 tree status
Name        : boot
Current     : no
Enabled     : no
Allowed     : root
Groups      : boot
Depends     : None
Required by : None
Contents    : boot@system:mount-run boot@system:system-hostname
              boot@system:populate-run boot@system:mount-tmp
              boot@system:populate-tmp boot@system:populate-sys
              boot@system:mount-pts boot@system:mount-shm
              boot@system:populate-dev boot@system:mount-cgroups
              boot@system:mount-branch boot@system:system-hwclock
              boot@system:modules-kernel boot@system:system-random
              boot@system:system-sysctl boot@system:udevd-log
              boot@system:udevd boot@system:udevadm
              boot@system:system-fontnkey boot@system:system-fsck
              boot@system:system-branch boot@system:mount-rw
              boot@system:mount-swap boot@system:local-time
              boot@system:local-loop boot@system:local-sethostname
              boot@system:local-authfiles boot@system:local-rc
              boot@system:local-dmesg boot@system:local-branch
              boot@system:runtime-branch boot@system:canopy
              boot@system:tty-rc@tty1 boot@system:tty-earlier@tty12
              boot@system:tty-rc@tty2 boot@system

Name        : nfs-tree
Current     : no
Enabled     : no
Allowed     : root
Groups      : admin
Depends     : None
Required by : nfsclient-tree nfsserver-tree
Contents    : None

Name        : global
Current     : no
Enabled     : yes
Allowed     : root
Groups      : admin
Depends     : None
Required by : None
Contents    : dbus-log dbus seatd-log seatd slimski-log slimski
              connmand-log connmand nmbd-log nmbd smbd-log smbd ufw
              bluetoothd-log bluetoothd sshd-log sshd elogind-log elogind
              vsftpd-log vsftpd spice-vdagentd-log spice-vdagentd
              spice-vdagent-log spice-vdagent xeyes-log xeyes
              avahi-daemon-log avahi-daemon

Name        : nfsclient-tree
Current     : no
Enabled     : no
Allowed     : root
Groups      : admin
Depends     : nfs-tree
Required by : None
Contents    : rpc.statd-log rpc.statd rpc.idmapd-log rpc.idmapd
              rpc.gssd-log rpc.gssd

Name        : nfsserver-tree
Current     : no
Enabled     : no
Allowed     : root
Groups      : admin
Depends     : nfs-tree
Required by : None
Contents    : rpc.nfsd-log rpc.nfsd rpcbind rpcbind-log rpc.mountd
              rpc.mountd-log

[nevj@trinity s6]$ 

That puzzles me.
It may not matter as far as functioning goes.
Should I perhaps remove the individual daemon dependencies on rpcbind, and only have the tree dependencies.?
or
Should I retain the individual daemon dependencies and get rid of nfs-tree.?

Where should I put rpcbind, given that everything in 2 trees depends on it. In global maybe?

hum, this is a bad behavior obviously. It should keep the already enabled rpcbind service within the original tree meaning for you the nfs-tree tree.
I need to check that, thanks for your report.

Anyway, a workaround is to enable again your rpcbind at nfs-tree by

# 66 -t nfs-tree enable rpcbind

Now, in fact you absolutely don’t care about the associate tree of the service :). Interdependence of service take precedence over interdependence of tree.

Let’s say nfsserver-tree depends on nfsclient-tree and rpc.statd depends on rpcbind. rpc.statd is within the tree nfsclient-tree and rpcbind is within nfsserver-tree. At start time of the nfsclient-tree tree, the rpc.statd service will ask to 66 to start first the rpcbind service (as is depend on it), and 66 will try to start it even if the tree nfsserver-tree is not already started. Then when the nfsserver-tree start, it found the rpcbind already up and do nothing about it and continue the start the others services of the tree.

2 Likes

OK, but it is not the end of the world.
I can get both the client and server to work.
It is more about learning how to design thing… nfs was a good learning case.
I think I will try to simplify the setup.

You explained it nicely. It does not matter which tree rpcbind is in, if it is a dependency 66 will find it when needed.
Thanks.
Neville

Am I correct in assuming that these are not present in your initial
distribution of init-diversity spins?

I want to go back to looking at user services. You seem to have hit bugs with that. Maybe I should move to Obarun? What do you think?

That is correct although you can install them with apt.

User services can be used with the latest 66 (0.7.0.2) & oblibs (0.2.1.3) which are available in my repo, so any bugs I ran into had been resolved at that point.

But if you really want to test 66 and its full potential you should also give Obarun a spin, everything there has been configured with 66 in mind.

@ProwlerGr
please note 0.7.1.1 Bugs fix release · Eric Vidal / 66 · GitLab
bug fix release.

what kind of bugs?

I will have a try. My current version is 0.7.0.0.0. I need to update.

I agree.
I think what I will do is wind up this antix-init-diversity topic with a summary first, then
start a new topic with Obarun.

I have filled a bug report for the newest (0.7.1.1) release

The previous 66 (0.7.0.2) & oblibs (0.2.1.3) work fine for me on antiX

I was reading reply #90 and #93.
It would seem this has been dealt with in later releases.
Ignore the bug comment.

1 Like

You’ll most likely be hit by the antiX expired keyring:

Running

wget -c http://repo.antixlinux.com/antix-archive-keyring_20019.5.0_all.deb
sudo dpkg -i antix-archive-keyring_20019.5.0_all.deb
sudo apt update && sudo apt upgrade
sudo apt install 66-service-boot-user 66-service-scandir

Should get you to the point that you will need to configure & start the boot-user module.

sudo 66 parse boot-user@nevj
sudo 66 configure -e nano boot-user@nevj
sudo 66 reconfigure boot-user@nevj

with config

## Uncomment it to use a display manager.
## Can be any display manager as long as the
## corresponding frontend file exist on your system
## e.g sddm,lightdm,...
## It also prepare the .xsession file.
DISPLAY_MANAGER=slimski
## Uncomment it to use a console tracker.
## Can be any console tracker as long as the
## corresponding frontend file exist on your system
## e.g consolekit,seatd,turnstile,...
CONSOLE_TRACKER=seatd
## Create and mount the XDG_RUNTIME directory
## at /run/user/demo [yes|no]
XDG_RUNTIME=!yes
## Command to use in your .xinitrc
## to launch your desktop e.g.: openbox-session.
## If commented the .xinitrc file is not configured.
DESKTOP_CMDLINE=!icewm
2 Likes

I reinstalled everything I could find in the Software GUI under enabled repos
66, 66-tools, boot-66-server, s6-66-init, s6-66-services
That got me to

# 66 version
version: info: 0.7.0.2

but no sign of boot-user@ module.

I will now follow your instructions

wget -c http://repo.antixlinux.com/antix-archive-keyring_20019.5.0_all.deb
sudo dpkg -i antix-archive-keyring_20019.5.0_all.deb
sudo apt update && sudo apt upgrade
sudo apt install 66-service-boot-user 66-service-scandir

Thank you.

sudo apt install 66-service-boot-user 66-service-scandir

Will get you that module.

Don’t forget to start your scandir using the -e option before enabling a user tree

(66 scandir start -e /etc/66/environment&)&
3 Likes

@ProwlerGr @obarun
Did you notice… we got to 1.0K views on this topic.
People are interested in S6-66

3 Likes

It is also your drive @nevj on this topic especially with your unbiased opinion & genuine experience to get things working with 66 which I believe generates a lot of interest.

3 Likes

It is also a rare opportunity for people to hear from intelligent and friendly developers.
You and @obarun have lifted this topic into another realm.

2 Likes

It all seems to have worked

root@antix-init-diversity:/home/nevj# wget -c http://repo.antixlinux.com/antix-archive-keyring_20019.5.0_all.deb
--2024-05-29 10:49:15--  http://repo.antixlinux.com/antix-archive-keyring_20019.5.0_all.deb
Resolving repo.antixlinux.com (repo.antixlinux.com)... 72.143.17.194
Connecting to repo.antixlinux.com (repo.antixlinux.com)|72.143.17.194|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 17040 (17K) [application/x-debian-package]
Saving to: ‘antix-archive-keyring_20019.5.0_all.deb’

antix-archive-keyri 100%[===================>]  16.64K  49.2KB/s    in 0.3s    

2024-05-29 10:49:16 (49.2 KB/s) - ‘antix-archive-keyring_20019.5.0_all.deb’ saved [17040/17040]

root@antix-init-diversity:/home/nevj# dpkg -i antix-archive-keyring_20019.5.0_all.deb
(Reading database ... 198137 files and directories currently installed.)
Preparing to unpack antix-archive-keyring_20019.5.0_all.deb ...
Unpacking antix-archive-keyring (20019.5.0) over (20019.3.14) ...
Setting up antix-archive-keyring (20019.5.0) ...

Configuration file '/etc/apt/keyrings/antix-archive-keyring.gpg'
 ==> File on system created by you or by a script.
 ==> File also in package provided by package maintainer.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** antix-archive-keyring.gpg (Y/I/N/O/D/Z) [default=N] ? 
Installing new version of config file /etc/apt/trusted.gpg.d/antix-archive-keyring.gpg ...


root@antix-init-diversity:/home/nevj# apt update
Hit:1 http://security.debian.org bookworm-security InRelease
Get:2 http://ftp.au.debian.org/debian bookworm-updates InRelease [55.4 kB]
Ign:3 http://mx.debian.nz/antix/bookworm bookworm InRelease      
Hit:4 http://ftp.au.debian.org/debian bookworm InRelease
Err:5 http://mx.debian.nz/antix/bookworm bookworm Release
  404  Not Found [IP: 147.75.48.133 80]
Get:6 http://deb-s6-rc-66-init-experimental.duckdns.org:8080 experimental-s6 InRelease [12.5 kB]
Get:7 http://deb-s6-rc-66-init-experimental.duckdns.org:8080 experimental-s6/antix-s6 Sources [37.6 kB]
Get:8 http://deb-s6-rc-66-init-experimental.duckdns.org:8080 experimental-s6/antix-s6 amd64 Packages [86.4 kB]
Reading package lists... Done                                                  
E: The repository 'http://mx.debian.nz/antix/bookworm bookworm Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.


root@antix-init-diversity:/home/nevj# apt upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
  libwpe-1.0-1 libwpebackend-fdo-1.0-1
Use 'apt autoremove' to remove them.
The following packages will be upgraded:
  66 66-tools 66-tools-dbgsym oblibs oblibs-dbgsym
5 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 623 kB of archives.
After this operation, 13.3 kB disk space will be freed.
Do you want to continue? [Y/n] y
Get:1 http://deb-s6-rc-66-init-experimental.duckdns.org:8080 experimental-s6/antix-s6 amd64 66-tools-dbgsym amd64 0.1.0.2experimental1-1 [104 kB]
Get:2 http://deb-s6-rc-66-init-experimental.duckdns.org:8080 experimental-s6/antix-s6 amd64 oblibs-dbgsym amd64 0.3.0.0experimental1-1 [83.3 kB]
Get:3 http://deb-s6-rc-66-init-experimental.duckdns.org:8080 experimental-s6/antix-s6 amd64 oblibs amd64 0.3.0.0experimental1-1 [53.5 kB]
Get:4 http://deb-s6-rc-66-init-experimental.duckdns.org:8080 experimental-s6/antix-s6 amd64 66-tools amd64 0.1.0.2experimental1-1 [47.4 kB]
Get:5 http://deb-s6-rc-66-init-experimental.duckdns.org:8080 experimental-s6/antix-s6 amd64 66 amd64 0.7.1.1experimental1-1 [335 kB]
Fetched 623 kB in 11s (58.2 kB/s)
(Reading database ... 198138 files and directories currently installed.)
Preparing to unpack .../66-tools-dbgsym_0.1.0.2experimental1-1_amd64.deb ...
Unpacking 66-tools-dbgsym (0.1.0.2experimental1-1) over (0.1.0.1experimental1-1) ...
Preparing to unpack .../oblibs-dbgsym_0.3.0.0experimental1-1_amd64.deb ...
Unpacking oblibs-dbgsym (0.3.0.0experimental1-1) over (0.2.1.3experimental1-1) ...
Preparing to unpack .../oblibs_0.3.0.0experimental1-1_amd64.deb ...
Unpacking oblibs (0.3.0.0experimental1-1) over (0.2.1.3experimental1-1) ...
Preparing to unpack .../66-tools_0.1.0.2experimental1-1_amd64.deb ...
Unpacking 66-tools (0.1.0.2experimental1-1) over (0.1.0.1experimental1-1) ...
Preparing to unpack .../66_0.7.1.1experimental1-1_amd64.deb ...
Unpacking 66 (0.7.1.1experimental1-1) over (0.7.0.2experimental1-1) ...
Setting up oblibs (0.3.0.0experimental1-1) ...
Setting up oblibs-dbgsym (0.3.0.0experimental1-1) ...
Setting up 66 (0.7.1.1experimental1-1) ...
Setting up 66-tools (0.1.0.2experimental1-1) ...
Setting up 66-tools-dbgsym (0.1.0.2experimental1-1) ...
Processing triggers for libc-bin (2.36-9+deb12u7) ...


root@antix-init-diversity:/home/nevj#  apt install 66-service-boot-user 66-service-scandir
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libwpe-1.0-1 libwpebackend-fdo-1.0-1
Use 'apt autoremove' to remove them.
The following NEW packages will be installed:
  66-service-boot-user 66-service-scandir
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 6,728 B of archives.
After this operation, 41.0 kB of additional disk space will be used.
Get:1 http://deb-s6-rc-66-init-experimental.duckdns.org:8080 experimental-s6/antix-s6 amd64 66-service-boot-user all 0.5.0experimental1-1 [3,332 B]
Get:2 http://deb-s6-rc-66-init-experimental.duckdns.org:8080 experimental-s6/antix-s6 amd64 66-service-scandir all 0.4.1experimental1-1 [3,396 B]
Fetched 6,728 B in 11s (635 B/s)
Selecting previously unselected package 66-service-boot-user.
(Reading database ... 198137 files and directories currently installed.)
Preparing to unpack .../66-service-boot-user_0.5.0experimental1-1_all.deb ...
Unpacking 66-service-boot-user (0.5.0experimental1-1) ...
Selecting previously unselected package 66-service-scandir.
Preparing to unpack .../66-service-scandir_0.4.1experimental1-1_all.deb ...
Unpacking 66-service-scandir (0.4.1experimental1-1) ...
Setting up 66-service-boot-user (0.5.0experimental1-1) ...
Setting up 66-service-scandir (0.4.1experimental1-1) ...

OK, so what files did it install?

nevj@antix-init-diversity:/usr/share/66/service/boot-user
$ ls -F
'boot-user@'   configure/   frontend/

$ cat boot-user@
[main]
@type = module
@version = 0.5.0
@description = "Configure a nested supervision tree for @I user"
@user = ( root )
@depends = ( scandir@@I )
@intree = session

[regex]
@configure = "@I"
@infiles = ( ::@version@=0.5.0 )

[environment]
## Uncomment it to use a display manager.
## Can be any display manager as long as the
## corresponding frontend file exist on your system
## e.g sddm,lightdm,...
## It also prepare the .xsession file.

#DISPLAY_MANAGER=sddm

## Uncomment it to use a console tracker.
## Can be any console tracker as long as the
## corresponding frontend file exist on your system
## e.g consolekit,elogind,...

#CONSOLE_TRACKER=consolekit

## Create and mount the XDG_RUNTIME directory
## at /run/user/@I [yes|no]

XDG_RUNTIME=!yes

## Command to use in your .xinitrc
## to launch your desktop e.g.: openbox-session.
## If commented the .xinitrc file is not configured.

DESKTOP_CMDLINE=!jwm

So it installs a template in /usr/shaer/66/…
We can see that boot-user@ is a module, and its parameter “@I” is used to set the user UID number for scandir and for the XDG_RUNTIME directory.
and
its services will be activated in a tree called ‘session’
and
it looks like it has to be setup by root
and
it configures .xinitrc to a particular window manager.

OK lets see if we can configure it

root@antix-init-diversity:~# 66 configure -e nano boot-user@nevj

configure: fatal: service: boot-user@nevj is not parsed -- try to parse it first using '66 parse boot-user@nevj'

root@antix-init-diversity:~# 66 parse boot-user@nevj
tree: info: Created successfully tree: session
tree: info: Permissions rules set successfully for tree: session
parse: info: launch configure script of module: scandir@nevj
scandir@nevj: info: set live directory to: /run/66/
scandir@nevj: info: enable service: setenv@nevj
scandir@nevj: info: enable logger options
scandir@nevj: info: enable notification
scandir@nevj: info: set verbosity level to: 3
scandir@nevj: info: successfully configured
parse: info: launch configure script of module: boot-user@nevj
boot-user@nevj: info: enable service: mount-run@nevj
boot-user@nevj: info: set environment at .xinitrc file to: /home/nevj/.66/conf/svscan@nevj
boot-user@nevj: info: set commandline at .xinitrc file to: jwm
boot-user@nevj: info: create /home/nevj/.xinitrc
boot-user@nevj: info: successfully configured
parse: info: Parsed successfully: scandir@nevj:setenv@nevj at tree: session
parse: info: Parsed successfully: scandir@nevj:svscan@nevj at tree: session
parse: info: Parsed successfully: scandir@nevj:svscan@nevj-log at tree: session
parse: info: Parsed successfully: scandir@nevj at tree: session
parse: info: Parsed successfully: boot-user@nevj:mount-run@nevj at tree: session
parse: info: Parsed successfully: boot-user@nevj at tree: session
parse: info: Parsed successfully: elogind-log at tree: global
parse: info: Parsed successfully: elogind at tree: global

root@antix-init-diversity:/etc/66/service# ls -F
 avahi-daemon	    nmbd	     seatd	      user/
 bluetoothd	    old/	     slimski	      vsftpd
'boot@system'/	    rpcbind	     smbd	      wpa-supplicant
'boot-user@nevj'/   rpc.gssd	     spice-vdagent    xeyes
 connmand	    rpc.idmapd	     spice-vdagentd   xrdp
 dbus		    rpc.mountd	     sshd	      xrdp-sesman
 dhcpcd		    rpc.nfsd	     sshd.hide.orig
 elogind	    rpc.statd	     ubus
 NetworkManager    'scandir@nevj'/   ufw

root@antix-init-diversity:/etc/66/service# ls boot-user@nevj
activated  configure  frontend

root@antix-init-diversity:/etc/66/service/boot-user@nevj/frontend# cat mount-run@
[main]
@type = oneshot
@version = 0.5.0
@description = "Mount /run/user directory of user @I"
@user = ( root )
[start]
@execute =
(
	if { 66-yeller -p mount-run@@I starts... }
	if -nt {
		execl-subuidgid -o @I
		execl-toc -X -m /run/user/${UID} -o noatime,nodev,nosuid,gid=${GID},uid=${UID},mode=0700,size=64M -t tmpfs -d user
	}
	66-yeller -fp mount-run@@I crashed!
)
root@antix-init-diversity:/etc/66/service/boot-user@nevj/frontend# cat mount-run@
[main]
@type = oneshot
@version = 0.5.0
@description = "Mount /run/user directory of user @I"
@user = ( root )
[start]
@execute =
(
	if { 66-yeller -p mount-run@@I starts... }
	if -nt {
		execl-subuidgid -o @I
		execl-toc -X -m /run/user/${UID} -o noatime,nodev,nosuid,gid=${GID},uid=${UID},mode=0700,size=64M -t tmpfs -d user
	}
	66-yeller -fp mount-run@@I crashed!
)

Well, that did something.
Now I have a boot-user@ directory in /etc/66/service
(There is also a scandir@nevj directory.)
and one of the things it contains is a frontend that makes the directory /run/user/${UID}

I think I still need to do configure

66 configure -e nano boot-user@nevj

nano screen

## Uncomment it to use a display manager.
## Can be any display manager as long as the
## corresponding frontend file exist on your system
## e.g sddm,lightdm,...
## It also prepare the .xsession file.
#DISPLAY_MANAGER=sddm
## Uncomment it to use a console tracker.
## Can be any console tracker as long as the
## corresponding frontend file exist on your system
## e.g consolekit,elogind,...
#CONSOLE_TRACKER=consolekit
## Create and mount the XDG_RUNTIME directory
## at /run/user/nevj [yes|no]
XDG_RUNTIME=!yes
## Command to use in your .xinitrc
## to launch your desktop e.g.: openbox-session.
## If commented the .xinitrc file is not configured.
DESKTOP_CMDLINE=!jwm

I changed jwm to rox-icewm

Now reconfigure it

root@antix-init-diversity:~# 66 reconfigure boot-user@nevj
parse: info: launch configure script of module: boot-user@nevj
boot-user@nevj: info: enable service: mount-run@nevj
boot-user@nevj: info: set environment at .xinitrc file to: /home/nevj/.66/conf/svscan@nevj
boot-user@nevj: info: set commandline at .xinitrc file to: rox-icewm
boot-user@nevj: warning: move existing /home/nevj/.xinitrc file to /home/nevj/.xinitrc-39551840855.backup
boot-user@nevj: info: create /home/nevj/.xinitrc
boot-user@nevj: info: successfully configured
parse: info: Parsed successfully: boot-user@nevj:mount-run@nevj at tree: session
parse: info: Parsed successfully: boot-user@nevj at tree: session

Now I should be able to start it

start: info: Initialized successfully: boot-user@nevj
start: info: Initialized successfully: scandir@nevj
signal: info: Initialized successfully: scandir@nevj:setenv@nevj
signal: info: Initialized successfully: scandir@nevj:svscan@nevj-log
signal: info: Initialized successfully: scandir@nevj:svscan@nevj
signal: info: Successfully started service: scandir@nevj:svscan@nevj-log
signal: info: Successfully started service: scandir@nevj:setenv@nevj
signal: info: Successfully started service: scandir@nevj:svscan@nevj
signal: info: Successfully started service: scandir@nevj
signal: info: Initialized successfully: boot-user@nevj:mount-run@nevj
signal: info: Successfully started service: boot-user@nevj:mount-run@nevj
signal: info: Successfully started service: boot-user@nevj

root@antix-init-diversity:~# 66 tree status

Name        : session
Current     : no
Enabled     : no
Allowed     : root
Groups      : admin
Depends     : None
Required by : None
Contents    : scandir@nevj:setenv@nevj scandir@nevj:svscan@nevj
              scandir@nevj:svscan@nevj-log scandir@nevj
              boot-user@nevj:mount-run@nevj boot-user@nevj

So it started, and now I have an extra tree called session.

I think that is the end of the root work.
I think what I do now is become user nevj, and try and setup
spice-vdagent as a user service , started when nevj begins an X session.

WARNING.
I WOULD NOT WANT SOMEONE TO BE DISCOURAGED BY THE ABOVE.
MOST OF IT WAS ONLY NECESSARY BECAUSE THE ANTIX INIT DIVERSITY RELEASE HAD AN OLDER VERSION OF 66 WHICH DID NOT CONTAIN THE THINGS NEEDED TO
CONTROL USER SERVICES EFFICIENTLY.
ALL THAT SHOULD BE NEEDED IN AN UPTODATE DISTRO WITH S6 LIKE OBARUN IS
FOR ROOT TO START BOOT-USER@NEVJ AND THAT WOULD GIVE NEVJ PERMISSION AND FACILITIES TO OPERATE USER SERVICES.

first, congrats!

Now, the difficulties is to know when to start the tree session and doing it automatically.
At boot time by enabling it? But what happens when we have multiple user at tree session like scandir@another_user?
That’s implies that i need to track user meaning i need a way to know is the user is connected or not.

This is the role of a login manager like consolekit, turnstile, logind, …
For a very very short explanation, the login manager is a daemon tracking the user activities and make action according to the event(event mean logon, logoff, from remote,…)

Each manager have its own manner to communicate and must be know to be able to know the state of the user.

Anyway, now with your configuration you can simply do as root

# 66 start boot-user@nevj

Then connect to nevj and create this dummy service ~/.66/service/test_env

[main]
@type = oneshot
@description = "simple oneshot the see the environ variable of the user scandir"
@version = 0.0.1
@user = ( user )

[start]
@execute = ( printenv )

then as nevj

% 66 start test_env
% 66 status -no logfile test_env

So, maybe a service more usefull like ~/.66/service/clipit

[main]
@type = classic
@description = "Clipt daemon"
@version = 0.0.1
@user = ( user )

[start]
@execute = ( clipit )

then

% 66 enable -S clipit # this command parse, enable and start the service

Now, look at the ~/.xinitrc for example. In this script file you should see a command like

66 tree start

So, when i use the command startx from the console to connect to the X session, the script will launch the 66 tree start as the user. As we have previously launched the corresponding boot-user@ service, all trees enables for the user will be started.

This is a very quick and short explanation. More question and answer will certainly come during your experimentation.

Thanks you so much to spend time on 66 and share your experience.

1 Like

Thank you.
I appreciate that you are still working on user services.
To get to try it now is a privilige.

1 Like

I appreciate the issues here… detectectin active users and keeping multiple users separate.
For now we will do as you suggest and start the boot-user@service manually for one user

root@antix-init-diversity:/home/nevj# 66 start boot-user@nevj
start: info: Initialized successfully: boot-user@nevj
start: info: Initialized successfully: scandir@nevj
signal: info: Initialized successfully: scandir@nevj:setenv@nevj
signal: info: Initialized successfully: scandir@nevj:svscan@nevj-log
signal: info: Initialized successfully: scandir@nevj:svscan@nevj
signal: info: Successfully started service: scandir@nevj:svscan@nevj-log
signal: info: Successfully started service: scandir@nevj:setenv@nevj
signal: info: Successfully started service: scandir@nevj:svscan@nevj
signal: info: Successfully started service: scandir@nevj
signal: info: Initialized successfully: boot-user@nevj:mount-run@nevj
signal: info: Successfully started service: boot-user@nevj:mount-run@nevj
signal: info: Successfully started service: boot-user@nevj

Apart from starting the module boot-user@nevj, it starts a number of services which are contained in the module

  • svscan@nevj – starts a scandir for nevj , so if you look in /run/66/scandir you see
nevj@antix-init-diversity:/run/66/scandir
$ ls -F
0/  1000/
nevj@antix-init-diversity:/run/66/scandir
$ ls -F 1000
fdholder/  oneshotd/
  • setenv@nevj – sets some environment variables for nevj
  • mount-run@nevj – mounts the /run/user directory for nevj
nevj@antix-init-diversity:/run/user
$ ls -F
1000/

The directory 1000 is empty.

Now lets setup the service test_env suggested by @obarun

nevj@antix-init-diversity:~/.66/service
$ 66 start test_env
parse: info: Parsed successfully: test_env at tree: global
start: info: Initialized successfully: test_env
signal: info: Successfully started service: test_env
nevj@antix-init-diversity:~/.66/service
$ 66 status -no logfile test_env

USER=nevj
HOME=/home/nevj
LOGNAME=nevj
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/lib/execline/bin:/usr/lib/execline/bin:/usr/libexec
SHELL=/usr/bin/bash
DISPLAY=:0
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
XDG_RUNTIME_DIR=/run/user/1000
XDG_CACHE_HOME=/home/nevj/.cache
XDG_CONFIG_HOME=/home/nevj/.config
XDG_DATA_HOME=/home/nevj/.local/share
XDG_DATA_DIRS=/home/nevj/.local/share:/usr/local/share:/usr/share
XDG_SESSION_CLASS=user

So it lists all the environment variables for nevj
It is a ‘oneshot’ it does not keep running.

Now lets try to start my spice-vdagent service as nevj

nevj@antix-init-diversity:~/.66/service
$ cat spice-vdagent
[main]
@type=classic
@description="spice-vdagent daemon"
@version=0.0.1
@user=(nevj)

[start]
@execute=(
    /usr/bin/spice-vdagent -x
)

[environment]
DISPLAY=:0.0

now start it
nevj@antix-init-diversity:~/.66/service
$ 66 start spice-vdagent
start: info: Initialized successfully: spice-vdagent
start: info: Initialized successfully: spice-vdagent-log
signal: info: Successfully started service: spice-vdagent-log
signal: info: Successfully started service: spice-vdagent
nevj@antix-init-diversity:~/.66/service
$ ps ax | grep spice
  870 ?        S      0:00 s6-supervise spice-vdagentd-log
  871 ?        S      0:00 s6-supervise spice-vdagentd
  942 ?        Ss     0:00 /usr/bin/s6-log -d3 n3 s1000000 /var/log/66/spice-vdagentd
  972 ?        Ssl    0:00 /sbin/spice-vdagentd -x -d
 8080 ?        S      0:00 s6-supervise spice-vdagent-log
 8081 ?        S      0:00 s6-supervise spice-vdagent
 8088 ?        Ss     0:00 /usr/bin/s6-log -d3 n3 s1000000 /home/nevj/.66/log/spice-vdagent
 8092 ?        Ssl    0:00 /usr/bin/spice-vdagent -x

There it is running … process 8092
One more thing

$xhost +

And now I can copy/past between the VM and the host.

So what have we achieved?

  • I can start the spice-vdagent service as nevj, without having to
    manually do
    (66 scandir start -e /etc/66/environment&)&
    every time I login
  • I still have to become root and do 66 start boot-user@nevj but that requirement will disappear when we can set up boot-user@nevj
    to start automatically when nevj logs in.

So we have shown that S6-66 can start spice-vdagent, the way it is meant to be started, whenever a user X session is started.
I am not sure if we can avoid starting it for a user ssh login ( no X session )

Oh, I get it, I have to do

$ 66 enable -S spice-vdagent
enable: info: Enabled successfully: spice-vdagent-log
enable: info: Enabled successfully: spice-vdagent
signal: info: Successfully started service: spice-vdagent
signal: info: Successfully started service: spice-vdagent-log

and that adds a line

66 tree start

to my .xinitrc file.
So… it will only do 66 tree start if the .xinitrc file is invoked, ie if there is an X session. It will not start it for an ssh login or for a console login. That is what is required.
The only thing not covered is the need to do xhost +

Now I will post this reply, and do a reboot and see what I need to do to get back to here.

Well after a reboot, I of course had to do
66 start boot-user@nevj
again, and
the .xinitrc file still contained 66 tree start
but that had not been executed , because there was no spice-vdagent running
so, either

  • .xinitrc is being invoked before I do 66 start boot-user@nevj so
    it does not have the environment set up, or
  • Antix is not using .xinitrc.

If I invoke 66 tree start by hand as nevj
spice-vdagent runs,
and all I have to do is xhost +

I think that is just a limitation of the current state of development of 66. When boot-user@nevj can be autostarted, it will start earlier,
hopefully before .xinitrc, and this issue will disappear.

For now, I am satisfied that s6-66 can manage a user service, and that in future it will be able to trigger it when a user starts an X session.

I dont know what provision there would be if one needed a user service to autostart at a console or ssh login ( ie without X) , or with Wayland, but I am sure this could be achieved.

The key thing about user services in s6-66 is that they are managed with all the same commands as root services. Only the initial permission, given by root, is extra.
A user’s global tree is separate from root’s global tree, as is any tree a user creates. When operating as a user, one only sees trees belonging to that user. User services and trees are separate, in the same way that user filesystems are separate.
I think we should wait for further development in the area of automatically initialising a user’s setup. Everything else is functional.

3 Likes

No, the .xinitrc file is a configuration file for the startx program. If you do

% startx

for your console(assuming you have the xorg-xinit package installed), it will read and apply instructions found to this file and so start the tree for the user. You can also combine this will automatic login. As long as the scandir@ is running, the corresponding user services will be started.

The .xsession file is the configuration file generally used by DM (Display Manager) like slimski(not sure about this one), lxdm, sddm and so on.
So, if your .xsession define the 66 tree command, it will be launch at login through the DM employed.

You can accomplish the same cool with different tools. Some use consolekit2, turnstile or even logind to track user and make the XDG_RUNTIME_DIR directory(this directory need to be made by root) before launching the service user.

Also, the vast majority of DE provide a way to start some command at log in user time. This also can be used for invocation of the 66 tree command.

In synthesis, 66 is responsible to manage and keep a sane state of services even for users but it’s not its role to track users. Tracking user is made by another components and involve a lot of things (permissions to use a specific device, seat management, permissions to use keyboard, screen, mouse, and so on). This day, many tools use the PAM program to know activities of the user for example connecting from ssh.

Again, 66 works on mechanism not on policies. It’s the responsibility of the sysadmin to properly set the different component to accomplish such a goal.
I have a personal tools to track user called utlogd but to be honest i’m not happy with it. It was a very first shot to understand and know how the things goes together.

3 Likes