You are not logged in.
FYI, there is an exhaustive comparison chart between sysvinit, upstrart, systemd and minirc:
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
Nice comparison.
Love the green "No" and red "Yes" . But at the bottom, you have used green for "Yes", and this is confusing. I think there should be consistency.
Offline
But at the bottom, you have used green for "Yes", and this is confusing. I think there should be consistency.
It's not a mistake. Read the summary if you don't get it.
Offline
I am talking about the colour coding. Usually a colour is associated with a context, for example, green for positive, red for negative.
I guess the context here is that green is for minirc's features.
Offline
No, it says an init system has two tasks:
1. Be the parent of all processes. So for table item, "Is the parent of all processes," YES is green, NO is red.
2. Run scripts on boot and shutdown. So for table item, "Run scripts on boot and shutdown," YES is green, NO is red.
Other tasks are not for an init system. So for other table items NO is green and YES is red.
Offline
Little offtop. I just wonder if it is possible to replace with busybox not only init subsystem but also other parts of core. Does anyone succeed or have experience with it? I tried long time ago but with no luck :-(
Here nice wiki poage with PKGBUILDs links https://wiki.archlinux.org/index.php/Base2busybox
It would be awesome if someone could pick up where I left off Especially a busybox-based init system would be great.
Also if the default sh could point to busybox ash.
There may be even more base packages that can be converted to busybox symlinks (tar, cpio, ...)
A meta-package for a base2busybox conversion of Arch would be very nice too...
My AUR packages
Any package of mine is up for grabs. If you think you could mantain it better - just contact me!
Offline
nbvcxz wrote:Little offtop. I just wonder if it is possible to replace with busybox not only init subsystem but also other parts of core. Does anyone succeed or have experience with it? I tried long time ago but with no luck :-(
Here nice wiki poage with PKGBUILDs links https://wiki.archlinux.org/index.php/Base2busyboxIt would be awesome if someone could pick up where I left off :) Especially a busybox-based init system would be great.
Also if the default sh could point to busybox ash.
What do you mean with a busybox-based init system, other than what is presented in this thread? ^^
Minirc also works in busybox ash by the way.
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
W.F.Cody wrote:nbvcxz wrote:Little offtop. I just wonder if it is possible to replace with busybox not only init subsystem but also other parts of core. Does anyone succeed or have experience with it? I tried long time ago but with no luck :-(
Here nice wiki poage with PKGBUILDs links https://wiki.archlinux.org/index.php/Base2busyboxIt would be awesome if someone could pick up where I left off Especially a busybox-based init system would be great.
Also if the default sh could point to busybox ash.What do you mean with a busybox-based init system, other than what is presented in this thread? ^^
Minirc also works in busybox ash by the way.
Sorry about not being clear. I meant the bigger-picture project of a "base2busybox" conversion package, where obviously a busybox-based init would be a part of it.
My AUR packages
Any package of mine is up for grabs. If you think you could mantain it better - just contact me!
Offline
I was just reading through the minirc code and I thought I'd point out that the following function isn't very portable:
echo_color() {
color=$1
shift
echo -e "[1;3${color}m$@[0m"
}
"echo -e" isn't portable. You should use:
printf "\033[01;3${color}m$@\033[00m\n"
It's not worth forking, branching, committing and making a pull request just for that
Last edited by jakobcreutzfeldt (2013-05-27 16:33:58)
Offline
Thank you, jakobcreutzfeldt. I applied your modification.
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
At the risk of a necrobump, is anyone still working on this? I have it working well with udev, but I'm not sure how to make it work with busybox mdev. I've read Gusar's posts and the topics he linked, (and this) but I'm still not sure how to proceed.
Last edited by 2ManyDogs (2013-08-13 00:56:32)
Offline
I wouldn't call it a necrobump but thanks for bringing this thread to the front page since I had forgotten about it. Just had to do some workarounds for the new systemd being unfriendlier so it's time I set this up.
I want to use mdev so I'll make some noise about how it goes.
Cheers
Last edited by moetunes (2013-08-13 08:06:11)
You're just jealous because the voices only talk to me.
Offline
Well, mdev should "work". It's just a matter of configuring the hell out of it until it suits your needs. I sadly haven't gotten around to it, perhaps I've been spoiled too much by the modern udev variants that do everything out of the box.
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
inittab seems a little extreme at shutdown, which is basically: send TERM, wait just 1 second, then send KILL.
It would be much nicer to have a sensible polling timeout, e.g. in BASH:
signals() {
# sync first (as in Debian), so disk flushing does not affect timeout
sync
echo -n "Sending all processes the TERM signal... "
killall5 -15 -o 1 # SIGTERM
# Taken from /debian/src/initscripts/etc/init.d/ in:
# http://packages.ubuntu.com/source/saucy/sysvinit
for n in `seq 1 20` ; do
# Use SIGCONT/signal 18 to check if there are processes left
killall5 -18 -o 1
# https://mailman.archlinux.org/pipermail/arch-projects/2011-July/001434.html
if [[ $? -eq 2 ]] ; then
echo "terminated in $n."
return 0
fi
sleep 0.5
done
# Not all died voluntarily
echo -n "Killing stubborn... "
killall5 -9 -o 1 # SIGKILL
echo "done."
}
Regarding mdev, I would suggest eudev instead.
Offline
Regarding mdev, I would suggest eudev instead.
On one of my desktops I have been using https://aur.archlinux.org/packages/eudev-git/ for 2 months now without problems, so I didn't feel compelled to try mdev.
Mektub
Follow me on twitter: https://twitter.com/johnbina
Offline
inittab seems a little extreme at shutdown, which is basically: send TERM, wait just 1 second, then send KILL.
I'm just checking this out, and I'm curious why any of this is even in inittab. Busybox's init already handles this internally - admittedly via the method that brebs is questioning, but if you put this in inittab, then you send TERM to all processes, wait 1 second, then send KILL to all processes ... then busybox's init sends TERM to all processes, waits 1 second, then sends KILL to all processes.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
brebs wrote:inittab seems a little extreme at shutdown, which is basically: send TERM, wait just 1 second, then send KILL.
I'm just checking this out, and I'm curious why any of this is even in inittab. Busybox's init already handles this internally - admittedly via the method that brebs is questioning, but if you put this in inittab, then you send TERM to all processes, wait 1 second, then send KILL to all processes ... then busybox's init sends TERM to all processes, waits 1 second, then sends KILL to all processes.
Busybox kills everything at the last moment before rebooting. Doing it manually is the only way* to first kill all processes, then unmounting all partitions, then shutting down the comuter, in that order. I need to be able to unmount partitions *after* killing all processes because otherwise umount may fail when a process is accessing the hard drive, leaving the file system in an unclean state.
* except modifying busybox, of course.
Last edited by hut (2013-08-31 01:23:45)
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
Thanks - I figured I might be missing something - that makes complete sense.
I just started digging around in busybox's code, and saw that, and it struck me as a bit odd.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
killall5 -18 -o 1
# https://mailman.archlinux.org/pipermail … 01434.html
if [[ $? -eq 2 ]] ; then
I just took a quick look at procps/kill.c in busybox 1.21.1, and it seems that there is no need for "-o 1", since 1 is automatically omitted:
if (p->sid == (unsigned)sid
|| p->pid == (unsigned)pid
|| p->pid == 1
) {
continue;
However, the value of 2 doesn't seem to be returned by busybox's killall5 - it would need patching to work more like sysvinit's patched-up killall5. Edit: busybox 1.22.0 includes Gusar's patch
One thing that took me ages to debug, with sysvinit, was the occasional unclean (i.e. filesystem not unmounted) shutdown, if I'd recompiled system libs - I finally traced it back to it needing "telinit u", which restarts PID 1. The real solution was to compile sysvinit as statically linked:
LDFLAGS+=" -static"
Which can be done in busybox's config with CONFIG_STATIC, although it increased the filesize from 800k to 1.8mb.
Last edited by brebs (2014-01-02 22:47:17)
Offline
However, the value of 2 doesn't seem to be returned by busybox's killall5 - it would need patching to work more like sysvinit's patched-up killall5.
Yep. I made such a patch, it's very simple:
diff -ur busybox.orig/procps/kill.c busybox/procps/kill.c
--- busybox.orig/procps/kill.c 2012-07-18 17:32:32.000000000 +0200
+++ busybox/procps/kill.c 2012-08-12 15:11:35.792678564 +0200
@@ -158,7 +158,7 @@
if (killall5) {
pid_t sid;
procps_status_t* p = NULL;
- int ret = 0;
+ int ret = 2;
/* Find out our session id */
sid = getsid(pid);
@@ -172,6 +172,7 @@
if (p->sid == (unsigned)sid
|| p->pid == (unsigned)pid
|| p->pid == 1
+ || p->sid == 0
) {
continue;
}
@@ -200,6 +201,7 @@
goto dont_kill;
}
kill(p->pid, signo);
+ ret = 0;
dont_kill: ;
}
resume:
Offline
Great project! Could anyone help me how to add connman to the custom_start bottom part of minirc.conf? Thanks.
edit: I'm asking because connman simply says "cannot connect to socket" ... also ufw just gives a bunch of iptables errors. I can't really figure out how to add any new daemons.
edit: socket is /run/dbus/system_bus_socket - something is going wrong when starting dbus
Last edited by gothmog123 (2013-09-07 09:24:35)
Offline
Great project! Could anyone help me how to add connman to the custom_start bottom part of minirc.conf? Thanks.
edit: I'm asking because connman simply says "cannot connect to socket" ... also ufw just gives a bunch of iptables errors. I can't really figure out how to add any new daemons.
edit: socket is /run/dbus/system_bus_socket - something is going wrong when starting dbus
Well, the first step is to figure out what commands you need to run in order to start the daemon. Once you know them, just add them like this:
custom_start () {
case "$1" in
connman)
<your commands here>
;;
*)
default_start "$@";; # keep the default as fall-back
esac
}
Sorry, I don't know anything about connman.
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline
Thanks hut. I did some tinkering and turns out dbus is not started properly. I did a dirty hack to make it work but I don't want to run my system like this. If anyone knows how to do this properly....
My hack is to rm -r /run/dbus && mkdir /run/dbus in the rc script....
Also after an update connman only runs with sudo in the custom start script. lol
Offline
Also after an update connman only runs with sudo in the custom start script. lol
Make sure to run the "rc start connman" command as root. (I'm guessing this problem occurs when you start it manually as a user, not on boot)
"hut_" or "h00th00t" in irc.freenode.net #archlinux
Ranger Mailing List: https://lists.nongnu.org/mailman/listinfo/ranger-users
Offline