Skip to main content
Topic: Yet Another Init System? Nitro init.  (Read 1479 times) previous topic - next topic
0 Members and 6 Guests are viewing this topic.

Re: Yet Another Init System? Nitro init.

Reply #1
After looking at the git repo I think this is likely a good replacement for runit.

The LOG service seems a particularly good idea; I don't really like the proctitle concept.

Certainly worth trying in a vm.

Re: Yet Another Init System? Nitro init.

Reply #2
Well I used artix lxqt-runit and di the following

1) copied /etc/runit/1 as /etc/nitro/SYS/setup made a few minimal services
acpid
agetty@
agetty@tty1 links to agetty
agetty@tty2
SYS
udevd

The agetty@/run is copied frrom runit''s  agetty-tty1 and uses arg 1 as the tty acpid udev just use runit run.

2) make in nitro git repo. copied nitro nitroctl to /bin

3) cd /bin && ln -sf nitro init

4) reboot

System did reboot but crashed during udev  https://pasteboard.co/LG1meDUOEMoU.png


Re: Yet Another Init System? Nitro init.

Reply #3
The project might be in the early stage of development. There are few "issues" in the github repo.
Artix Linux Colombia

Re: Yet Another Init System? Nitro init.

Reply #4
OK after thrashing around for an age I figured out that the agetty@/run should 1) source the conf to get properties for agetty and 2) using an exec makes things go wrong

I have only two services set up

agetty@

Code: [Select]
#!/bin/sh

tty=$1

[ -r '/etc/nitro/agetty@/conf' ] && . '/etc/nitro/agetty@/conf'

if [ -x /sbin/getty -o -x /bin/getty ]; then
# busybox
GETTY=getty
elif [ -x /sbin/agetty -o -x /bin/agetty ]; then
# util-linux
GETTY=agetty
fi

/bin/setsid /bin/${GETTY} ${GETTY_ARGS} \
"${tty}" "${BAUD_RATE}" "${TERM_NAME}"

agetty@tty1 and agetty@tty2 are symbolic links to agetty@.

I have a service udevd/run copied directly from runit. And SYS/setup is the /etc/runit/1 script.
With those set up I can log in and test nitroctl etc etc. Certainly nitroctl Shutdown (Reboot)  both work.

Re: Yet Another Init System? Nitro init.

Reply #5
OK I managed to get all the services I had running under runit to work under nitro

Code: [Select]
artix-runit:[root]:/home/robin# ls -alrt /etc/nitro
total 64
drwxr-xr-x  2 root root 4096 Aug 24 16:26 acpid
drwxr-xr-x  2 root root 4096 Aug 24 16:32 udevd
lrwxrwxrwx  1 root root    7 Aug 24 16:33 agetty@tty1 -> agetty@
lrwxrwxrwx  1 root root    7 Aug 24 16:33 agetty@tty2 -> agetty@
drwxr-xr-x  2 root root 4096 Aug 24 20:55 LOG
drwxr-xr-x  2 root root 4096 Aug 25 09:27 dbus
drwxr-xr-x  2 root root 4096 Aug 25 10:51 agetty@
drwxr-xr-x  2 root root 4096 Aug 25 11:06 SYS
drwxr-xr-x  2 root root 4096 Aug 25 11:37 avahi-daemon
drwxr-xr-x  2 root root 4096 Aug 25 11:39 alsabeep
drwxr-xr-x  2 root root 4096 Aug 25 11:40 cronie
drwxr-xr-x  2 root root 4096 Aug 25 11:40 sshd
drwxr-xr-x  3 root root 4096 Aug 25 11:47 .UNUSED
drwxr-xr-x 16 root root 4096 Aug 25 11:47 .
drwxr-xr-x  2 root root 4096 Aug 25 11:53 sddm
drwxr-xr-x  2 root root 4096 Aug 25 11:57 NetworkManager
drwxr-xr-x  2 root root 4096 Aug 25 11:59 bluetoothd
drwxr-xr-x 89 root root 4096 Aug 25 12:03 ..
artix-runit:[root]:/home/robin# nitroctl list
UP NetworkManager (pid 808) (wstatus 0) 53s
UP dbus (pid 809) (wstatus 0) 53s
UP acpid (pid 810) (wstatus 0) 53s
UP LOG (pid 812) (wstatus 0) 53s
UP sshd (pid 813) (wstatus 0) 53s
UP sddm (pid 865) (wstatus 256) 51s
UP agetty@tty2 (pid 816) (wstatus 0) 53s
UP agetty@tty1 (pid 818) (wstatus 0) 53s
UP bluetoothd (pid 820) (wstatus 0) 53s
UP cronie (pid 822) (wstatus 0) 53s
UP alsabeep (pid 826) (wstatus 0) 53s
UP avahi-daemon (pid 864) (wstatus 65280) 51s
UP udevd (pid 829) (wstatus 0) 52s
artix-runit:[root]:/home/robin#

I had to change some sv dbus checks into
Code: [Select]
if [ "$(nitroctl pidof dbus)" == 1 ];then exit 1; fi
The main problem was the issue of not using exec in the agetty@/run not sure why that's a problem,

Also the old standard runit commands shutdown and reboot don't work as advertised. Need to do nitroctl Shutdown / Reboot etc etc.

Re: Yet Another Init System? Nitro init.

Reply #6
Stop replabrobin! Soon he will be building iso!  ;D

Re: Yet Another Init System? Nitro init.

Reply #7
Stop replabrobin! Soon he will be building iso!  ;D
Not so fast  ;) others  are better than I at this stuff and nitro is far too new

Some data points comparing runit and nitro running console login only (I turned off sddm), not completely equivalent since I only have two agetty services in nitro

RUNIT
pstree: 18
processes: 147
threads: 156
runit-+-ModemManager---3*[{ModemManager}]
      |-elogind-daemon
      |-polkitd---3*[{polkitd}]
      `-runsvdir-+-runsv---NetworkManager---3*[{NetworkManager}]
                 |-runsv-+-dbus-daemon
                 |       `-svlogd
                 |-runsv-+-acpid
                 |       `-svlogd
                 |-runsv---sshd---sshd-session---sshd-session---bash---pstree
                 |-6*[runsv---agetty]
                 |-runsv---bluetoothd
                 |-runsv---crond
                 |-runsv---metalog---metalog
                 |-runsv---alsabeep-daemon---logger
                 |-runsv---avahi-daemon---avahi-daemon
                 |-runsv---pause
                 `-runsv---udevd

NITRO
pstree: 15
processes: 124
threads: 134
init-+-ModemManager---3*[{ModemManager}]
     |-NetworkManager---3*[{NetworkManager}]
     |-acpid
     |-alsabeep-daemon---logger
     |-avahi-daemon---avahi-daemon
     |-bluetoothd
     |-crond
     |-dbus-daemon
     |-elogind-daemon
     |-metalog---metalog
     |-polkitd---3*[{polkitd}]
     |-2*[run---agetty]
     |-sshd---sshd-session---sshd-session---bash---pstree

Re: Yet Another Init System? Nitro init.

Reply #8
I started to mess with nitro; seems to me that the services folder should not be the parent of the system startup, I hacked the code somewhat to move services into its own folder so now my version looks like

/etc/nitro/levels/default/svc1/...svcn/ SYS/
                 |           /single/....
                 |
                 /sv/asvc1...asvn
                 |
                 services-->levels/default

but I will likely want to allow services to be in /run/nitro, but currently /SYS/ has to be in a known location before setup starts. A bit more c hacking will might allow /etc/nitro/SYS/ to be separated from the services folder (maybe LOG as well).

To excite Worm_Jim here is my first working nsm code

Code: [Select]
obin@artix-runit:~
$ nsm -h
 ______   ____  __  __
 ╔╗╔╔═╗╔╦╗  Nitro Service Manager for Artix Linux (0.0.0)
 ║║║╚═╗║║║  Source:
 ╝╚╝╚═╝╩ ╩  MIT License

[nsm]    Manage and view nitro services
[nsm]    Made specifically for Artix Linux
[nsm]    Author: replabrobin

Code: [Select]
robin@artix-runit:~
$ nsm -v
>  - artix-runit (/etc/nitro/services) - 17 services

   SERVICE              STATE   ENABLED   PID      COMMAND           TIME
 ✔ acpid                UP-0    true      817      acpid             3 hours
 ✔ agetty@tty1          UP-0    true      823      sh                3 hours
 ✔ agetty@tty2          UP-0    true      822      sh                3 hours
 ✔ agetty@tty3          UP-0    true      832      sh                3 hours
 ✔ agetty@tty4          UP-0    true      829      sh                3 hours
 ✔ agetty@tty5          UP-15   true      2231     sh                41 minutes
 ✔ agetty@tty6          UP-0    true      838      sh                3 hours
 ✔ alsabeep             UP-0    true      834      alsabeep-daemon   3 hours
 ✔ avahi-daemon         UP-0    true      837      avahi-daemon: run 3 hours
 ✔ bluetoothd           UP-0    true      825      bluetoothd        3 hours
 ✔ cronie               UP-0    true      827      crond             3 hours
 ✔ dbus                 UP-0    true      816      dbus-daemon       3 hours
 ✔ LOG                  UP-0    true      819      logger            3 hours
 ✔ metalog              UP-0    true      831      metalog [MASTER]  3 hours
 ✔ NetworkManager       UP-0    true      815      NetworkManager    3 hours
 ✔ sshd                 UP-0    true      820      sshd -D [listener 3 hours
 ✔ udevd                UP-0    true      840      udevd             3 hours




Re: Yet Another Init System? Nitro init.

Reply #9
I made an AUR package to ease other init experimenters; I have only tested converting  an lxqt-runit.iso installation so
Worm_jim will have to wait for a lxqt-nitro. The PKGBUILD is a jumble of others' work, but it di did build for me.

I didn't really know how to do everything automatically so README.txt may help.

See https://aur.archlinux.org/packages/init-nitro (took me ages to upload due to ddos and my failure to understand).

Re: Yet Another Init System? Nitro init.

Reply #10
I'd reccommend backing up this repository elsewhere, since there are AUR users who really like filing removal requests for packages that conflict with systemd.



A few ideas:

  • This package could use a few of the standard 'provides' of Artix's inits. I'm sure svc-manager is one of them.
  • Apparently, the only things you changed in the runit-rc package were a few error messages. Ever tried reusing the installed runit-rc pacakge? It seems it only requires adding a provides of eudev-runit to the package.
  • The contents of etc-nitro.tar.xz could be part of the repository (as they are in system/runit's case). Not sure AUR would like that, though.
  • Downloading, patching and compiling the entirety of runit for just chpst seems like overkill (then again, I can't find any standalone clones of chpst this package could rely on other than this one, which adds quite a bit of setpriv-like features. At least Debian trusts it).

Re: Yet Another Init System? Nitro init.

Reply #11
Thanks for the warning. I have a local backup repo in mercurial. If it comes to it I can move to github. Don't think I left anything deliberately Artix except for some of the sources.

I found the structure of the runit dependencies too hard to understand and did not know how to 'just' install runit-rc apart from runit.

The AUR will not allow a subdirectory so I had to tar it up so it's a single file.

Yes, a bit overkilling to compile all of runit for chpst, but this is a quick hack to test not a well thought out package.

I thought svc-manager/eudev-runit  are sort of virtual packages. I did not figure out who/what does the final change to /usr/bin/init

Re: Yet Another Init System? Nitro init.

Reply #12
Looked at xchpst it seems a good replacement for chpst.

Edit: fwiw I tried to build xchpst as a static library (runit does static chpst) and it chokes on Arch & Artix because both lack a static libcap.a so the static load fails.