LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 07-17-2014, 06:53 AM   #46
stoat
Member
 
Registered: May 2007
Distribution: LFS
Posts: 628

Rep: Reputation: 185Reputation: 185

At least we're not alone out here.
 
Old 07-17-2014, 05:47 PM   #47
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,558

Original Poster
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
Yes, we aren't alone. A lot of people are taking notice that alternatives are needed not just to sysvinit, but systemd, upstart, and OpenRC as well. Alternatives that are small, simplistic, and work with the system rather than making the system work with it. Plus the backwards compatibility between Runit and sysvinit is exemplary, as our work clearly shows. Last I heard systemd now removed sysvinit script compatibility and uses a parsing tool to take sysvinit scripts and auto-convert them to systemd unit files.

Upstart was never a viable option in my opinion, and OpenRC is too undocumented to be of any real usage.

Taking a little extra time to thoroughly check everything out, so I don't want to give an exact date on this.

Last edited by ReaperX7; 07-17-2014 at 10:37 PM.
 
Old 07-17-2014, 10:00 PM   #48
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,558

Original Poster
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
Updated list:

acpid (ported - completed)
alsa-utils (covered by stage 1- not required)
apache (ported - completed)
at (ported - completed)
autofs (uncertain, but may have to add an installer for the default configuration script in blfs-bootscripts.)
avahi
bind
bluetooth (ported - completed)
bridge-utils (system service script. Might be resigned to stage 1)
cups (ported - completed)
dbus (ported -completed.)
dhclient (covered by service script in stage 1 - not required)
dhcpcd (covered by service script in stage 1- not required)
dhcpd (dhclient server)
dovecot
exim (ported - completed)
fcron (ported - completed)
gpm (ported - completed)
haveged
httpd - (Apache httpd daemon)
iptables (backported to stage 1 - not required)
ipx (system service script. Possible assignment to stage 1.)
kdm (ported - completed)
krb5
mysql (ported - completed)
netfs
NetworkManager
nfs-client
nfs-server
ntpd (ported - completed)
php-fpm
postfix (ported - completed)
postgresql
proftpd
random (assigned to stage 1 - not required)
rpcbind
rsyncd
samba (ported - completed)
saslauthd (may require an installer for the default configuration script in blfs-bootscripts somehow.)
sendmail
slapd (may require an installer for the default configuration script in blfs-bootscripts somehow.)
soprano
sshd (ported -completed)
stunnel
svn
swat - (was part of Samba initially, but seems to not be used any longer. Will remove if necessary.)
sysstat (assigned to stage 1 - not required)
unbound
virtuoso
vsftpd
wicd
winbindd - part of samba.
wpa ( system service script. Will probably be assigned to stage 1.)
xinetd
xnmap
zenmap
 
Old 07-17-2014, 10:13 PM   #49
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,558

Original Poster
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
Here are some service scripts that may need testing, I got a few from Runit's collection, some from VoidLinux, and others just from anywhere I found anything:

Avahi - Very few scripts exist for this service.
Code:
#!/bin/sh
sv check dbus >/dev/null || exit 1
exec avahi-daemon -s
dhcpd - server - needs log service.
Code:
#!/bin/sh
exec 2>&1
exec dhcpd -f -d -cf ./config eth0
bind(bind9)
Code:
#!/bin/sh
MEM="`head -1 ./env/MEM`"
CHROOT="`head -1 ./env/CHROOT`"
exec softlimit -m "${MEM}" \
  named -u bind -t "${CHROOT}" -g 2>&1
exim
Code:
#!/bin/sh
exec /usr/local/sbin/exim -bdf -q30m
postgresql
Code:
#!/bin/sh
exec setuidgid postgres /usr/lib/postgresql/bin/postmaster \
  -D /var/lib/postgres/data 2>&1
postgresql-log
Code:
#!/bin/sh
#Begin postgresql log service file
exec /usr/sbin/svlogd -tt /var/log/postgresql
#End of postgresql log service run file
proftpd - needs log service
Code:
#!/bin/sh
exec 2>&1
exec proftpd -n -d 1
unbound
Code:
#!/bin/sh
exec unbound -d
vsftpd- requires log service
Code:
#!/bin/sh
exec 2>&1
exec tcpserver -c30 -Xv -llocalhost \
  -x/etc/tcp.ftp.cdb -uvsftpd -gvsftpd 0 ftp \
    softlimit -d300000 /var/vsftpd/bin/vsftpd
wicd
Code:
#!/bin/sh
sv check dbus >/dev/null || exit 1
exec /usr/sbin/wicd --no-daemon
xinetd
Code:
#!/bin/sh
exec /usr/sbin/xinetd -dontfork
These are all the scripts I could find off-hand. The rest will either have to be created from the ground up, scavenged off other distributions and updated, or if necessary migrated into stage-1 using an if/elif/else trigger.

To be perfectly honest, Runit could be a major player in init for GNU/Linux, but only if enough advocacy would come forward for it, and distribution maintainers would design around it. It's a very stable init system, is fully compatible with sysv, and is fast, light, and simplified as a service manager.

How and why system designers never jumped on this, djbdts, perp, etc, really is confounding since they knew sysvinit and bsdinit would eventually need a successor. How the tools of Gerrit and Laurent never got mainstream (Runit and s6) just shows that there are too many people who have too many stigmas about trying new sound and sane software, and only look for quickie fix solutions regardless of how corrupting they are rather than anything sane.

Last edited by ReaperX7; 07-18-2014 at 07:41 PM.
 
Old 07-18-2014, 08:17 PM   #50
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,558

Original Poster
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
Edit:

I created a backwards compatible sysvinit run file as shown below. It's very crude and needs to be thoroughly tested. This is hopefully to cover enough services as possible, until a full set of scripts for these services can be designed.

I'm uncertain of the shutdown mechanics of the finish file, but hopefully, it will work.

Code:
#!/bin/bash -e

#©keithhedger Fri 9 May 11:41:42 BST 2014 kdhedger68713@gmail.com
#
#Based on scripts and hints by
#stoat http://www.linuxquestions.org/questions/user/stoat-343150/
#ReaperX7 http://www.linuxquestions.org/questions/user/reaperx7-603839/
#Here: http://www.linuxquestions.org/questions/linux-from-scratch-13/lfs-with-runit-without-sysv-4175503653/
#

# The purpose of this script is to create a backwards compatibility run file
# that will execute existing sysvinit stylized scripts in order according to their
# run time execution, and unload them when finished during the shutdown phase.

# If the end-user wishes to, they may add to the runscripts any daemons and services
# not covered by the BLFS book.

mkdir -vp /etc/sv/sysv/log

cat > /etc/sv/sysv/run << "EOF"
#!/bin/sh
# Begin sysv service run file

# First we'll execute a simple command to wait 10 seconds after Runit
# Stage-2 finishes it's loading. This way any unknowns are accounted for
# as far as possible dependencies are concerned.

exec sv -w10 || exit 1

# Service Number 22 rpcbind
if [ -f "/etc/rc.d/init.d/rpcbind" ]; then
   /etc/rc.d/init.d/rpcbind start
fi

# Service Number 23 saslauthd
if [ -f "/etc/rc.d/init.d/saslauthd" ]; then
   /etc/rc.d/init.d/saslauthd start
fi

# Service Number 23A xinetd
if [ -f "/etc/rc.d/init.d/xinetd" ]; then
   /etc/rc.d/init.d/xinetd start
fi

# Service Number 24 nfs-client
if [ -f "/etc/rc.d/init.d/nfs-client" ]; then
   /etc/rc.d/init.d/nfs-client start
fi

# Service Number 24A nfs-server
if [ -f "/etc/rc.d/init.d/nfs-server" ]; then
   /etc/rc.d/init.d/nfs-server start
fi

# Service Number 25 slapd (OpenLDAP)
if [ -f "/etc/rc.d/init.d/slapd" ]; then
   /etc/rc.d/init.d/slapd start
fi

# Service Number 27 dovecot
if [ -f "/etc/rc.d/init.d/dovecot" ]; then
   /etc/rc.d/init.d/dovecot start
fi

# Service Number 28 heimdal
if [ -f "/etc/rc.d/init.d/heimdal" ]; then
   /etc/rc.d/init.d/heimdal start
fi

# Service Number 28A kerberos v5
if [ -f "/etc/rc.d/init.d/krb5" ]; then
   /etc/rc.d/init.d/krb5 start
fi

# Service Number 28B netfs
if [ -f "/etc/rc.d/init.d/netfs" ]; then
   /etc/rc.d/init.d/netfs start
fi

# Service Number 30 dhcpd
if [ -f "/etc/rc.d/init.d/dhcpd" ]; then
   /etc/rc.d/init.d/dhcpd start
fi

# Service Number 30A rsyncd
if [ -f "/etc/rc.d/init.d/rsyncd" ]; then
   /etc/rc.d/init.d/rsyncd start
fi

# Service Number 32 vsftpd
if [ -f "/etc/rc.d/init.d/vsftpd" ]; then
   /etc/rc.d/init.d/vsftpd start
fi

# Service Number 33 Network Manager
if [ -f "/etc/rc.d/init.d/networkmanager" ]; then
   /etc/rc.d/init.d/networkmanager start
fi

# Service Number 33A svn
if [ -f "/etc/rc.d/init.d/svn" ]; then
   /etc/rc.d/init.d/svn start
fi

# Service Number 35 sendmail
if [ -f "/etc/rc.d/init.d/sendmail" ]; then
   /etc/rc.d/init.d/sendmail start
fi

# Service Number 37 qpopper
if [ -f "/etc/rc.d/init.d/qpopper" ]; then
   /etc/rc.d/init.d/qpopper start
fi

# Service Number 46 swat
if [ -f "/etc/rc.d/init.d/swat" ]; then
   /etc/rc.d/init.d/swat start
fi

# Service Number 47 virtuoso
if [ -f "/etc/rc.d/init.d/virtuoso" ]; then
   /etc/rc.d/init.d/virtuoso start
fi

# Service Number 48 soprano
if [ -f "/etc/rc.d/init.d/soprano" ]; then
   /etc/rc.d/init.d/soprano start
fi

# Service Number 50 winbindd
if [ -f "/etc/rc.d/init.d/winbindd" ]; then
   /etc/rc.d/init.d/winbindd start
fi

# Service Number 52 autofs
if [ -f "/etc/rc.d/init.d/autofs" ]; then
   /etc/rc.d/init.d/autofs start
fi

# Service Number 55 stunnel
if [ -f "/etc/rc.d/init.d/stunnel" ]; then
   /etc/rc.d/init.d/stunnel start
fi

# Service Number 99 lprng
if [ -f "/etc/rc.d/init.d/lprng" ]; then
   /etc/rc.d/init.d/lprng start
fi

# End of sysv service run file
EOF

cat > /etc/sv/sysv/finish << "EOF"
#!/bin/sh
# Begin sysv service finish file

# Let's try to shutdown the services ASAP as Runit will start the shutdown sequence.
SERVICES=lprng,stunnel,autofs,winbindd,soprano,virtuoso,swat,qpopper,sendmail,svn,networkmanager,vsftpd,rsyncd,dhcpd,netfs,krb5,heimdal,dovecot,slapd,nfs-server,nfs-client,xinetd,saslauthd,rpcbind

# If all goes well, all the services should come down simulaneously. It's a dirty way
# of shutting down services, but it should work.
if [ -f "/etc/rc.d/init.d/$SERVICES" ]; then
   /etc/rc.d/init.d/$SERVICES stop
fi

# End sysv service finish file
EOF

cat > /etc/sv/sysv/log/run << "EOF"
#!/bin/sh
#Begin sysv log service file
exec /usr/bin/svlogd -tt /var/log/sysv
#End of sysv log service run file
EOF

chmod +x /etc/sv/sysv/{run,finish,log/run}
mkdir -pv /var/log/sysv

ln -sv /etc/sv/sysv /etc/runit/runsvdir/multi
ln -sv /etc/sv/sysv /etc/runit/runsvdir/desktop

Last edited by ReaperX7; 07-21-2014 at 04:36 PM.
 
Old 07-21-2014, 10:38 PM   #51
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,558

Original Poster
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
Found this repository also:

https://github.com/chneukirchen/igni.../ignite/etc/sv

Seems interesting that I keep finding more and more little known distributions running Runit. A lot of the work is heavily streamlined and easy to read.

The stage 1, 2, and 3 scripts from both Ignite and Void are a little more comprehensive than ours are. I may see about reworking them to fit out needs, and see about importing their Shutdown script.

Found this too:

http://jtimberman.housepub.org/blog/...olved-problem/

It has links to a few websites including one called the Runit-Cookbook... Like... wow.

Last edited by ReaperX7; 07-21-2014 at 10:59 PM.
 
Old 07-22-2014, 08:35 AM   #52
stoat
Member
 
Registered: May 2007
Distribution: LFS
Posts: 628

Rep: Reputation: 185Reputation: 185
Quote:
Originally Posted by ReaperX7

I'm kind of inspired by VoidLinux's stage 1, and 3 scripts. I wonder if they can be useful on our end?
Its stage 2 reads /proc/cmdline and processes the kernel command line for a runlevel argument. That looked smart.
 
Old 07-22-2014, 12:49 PM   #53
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,558

Original Poster
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
I think that's to give an emergency Superuser shell in case something fails in stage 2. It's actually not a bad idea. I've been considering the aspect of moving more stuff into stage 2 and consolidating a more universalized stage 1.

I'm going to see the structuring of the Void and Ignite Runit stage 1 and see how it reflects against the LFS sysvinit scripts and see if I can rework the Void stage 1 into a usable bootscript for LFS.

Last edited by ReaperX7; 07-22-2014 at 03:55 PM.
 
Old 08-06-2014, 05:59 PM   #54
stoat
Member
 
Registered: May 2007
Distribution: LFS
Posts: 628

Rep: Reputation: 185Reputation: 185
Some init-related utilities modified not to need init-functions...
Attached Files
File Type: txt non-init-stuff.tar.gz.txt (3.0 KB, 23 views)
 
Old 08-10-2014, 12:51 AM   #55
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,558

Original Poster
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
Here's a good recent paper on Runit advocacy:

http://chneukirchen.org/talks/ignite...n2013slcon.pdf
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LFS with Runit (without SysV) ReaperX7 Linux From Scratch 119 07-10-2014 03:15 PM
Slax: what programs are in the official release JosephS Linux - Distributions 1 05-26-2009 01:43 PM
Mucked Around with Runit, switched back to sysvinit, and now no mouse/kb on laptop gohmifune Linux - Software 0 01-28-2009 10:09 AM
FC5 development release and FC5 official release- where is the DVD iso? smiley_lauf Fedora 11 03-13-2006 01:38 PM
10.1 64bit official release StraitFaced Mandriva 0 11-09-2004 01:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 02:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration