LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-26-2014, 11:37 PM   #1
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,558
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
Post How to get Runit working in Slackware.


I recently discovered that Runit had a Slackbuild after all this time http://slackbuilds.org/repository/14.1/system/runit/ , but there is little information on how to get it usable as a working init solution for Slackware other than trial and error testing by the end-user. In fact there's little info at all on it.

Hopefully, this will allow some insight into what needs to be done as well as open a door to have a 2nd if not 3rd working init system available for Slackware outside the default rc-init system and Bartgymnast's recent systemd project as shown here: http://www.linuxquestions.org/questi...ds-4175484413/

Short-term goal of this project:

1. Get Runit installed and get directories and symlinks created as well as all proper scripts drafted and installed.

2. Get Runit to boot Slackware into administrative mode at minimum to give a bare system that can be logged into to begin work.

Long-term Goals of this project:

1. Establish a working script set for Runit that can be either generated from a batch script set, or premade and installable by the end-user to supplement the SBO package, maybe even added as part of the package.

2. Preserve the Slackware rc-init system and possibly reuse certain sections of it for Runit with minimal custom scripting provided all goes well.

3. Establish a full working drop in ready init system for Slackware and Slackware based distributions.

Because I'll be working at this in my own time, which is sadly very minimal, this will serve as mostly a public blog for the project. Any and all criticism is welcome, positive and negative. Helpful insights into getting it working would be appreciated greatly, and contributors will be fully acknowledged. I will admit, that this is an undertaking and I'm stepping out of my comfort zone hugely by doing this, and I may fail at this greatly, but nothing ventured, nothing gained, and certainly, nothing learned.

To keep things at pace, I will edit in to the topic rather than perform repeated replies. This should serve to keep an easier to read How-To guide as well as document my findings, as well as post scripts as well.

=====================================================================

Blog section here:

After reading through the documentation, I was able to determine how exactly to install runit into Slackware following the install from the SBO. I had to edit some stuff, but at the moment, before I post any How-To's I want to at least get a working getty running. Thanks to Turtleli I was able to discover I need to use getty from getty-gs which is part of /a rather than agetty from the util-linux package.

I got a working boot running with a minor change in /etc/runit/1 as shown above with rc.M file added. This gave a proper boot, however this is still confined to stage 1 at the moment.

I also added the Gettys 1~6 as well. I'll try to condense the how-to above to include it, otherwise just duplicate each getty configuration as Getty-1 and tty1 and so on.

Runlevels for Single and Default added as well to documentation.

Started a generate script to auto-setup all required files. Will publish here upon completion. Script will be eventually used to auto-generate all required paths, scripts, etc. as needed.

Need to work on startup files with dependencies, but may leave those assigned to rc.M and rc.S until further notice.

Edit: 3-3-2014

Added Turtleli's shutdown hint to stage3. Testing in progress. Beginning migration of rc.M-runit and rc.S-runit customized boot scripts into runit stage1 master boot script. Moving other service calls into run scripts that are not related to the primary boot sequence for stage 2.

In case you've noticed, I've removed the setup scripts directly put onto the page and I've uploaded the actual work script I'm using. Please note that for now the script is considered a WIP (work-in-progress) so do take care using it. By no means am I done with the work, but I wanted to at least make the setup and file generation script publicly available. I don't know if I'd consider it ALPHA or BETA status, but just be careful!!!

There are some disabled commands at the bottom, mostly for future testing and usage. One is the build script for generating dependency handled loading of services. For now this is being kept disabled and unused until I can safely determine which exact services can be safely loaded in hybrid linear-parallel mode for stage2. For now I'm keeping these scripts strictly stage1 only especially networking. I actually want to refuse assigning this to stage2 just to keep it's service loading completely stable and reliable. You'll also see the unused init switch-out and backup command at the bottom. There are other commands as well that will be tested soon enough, especially the shutdown and reboot links.

To-Do List:

1. Backup Slackware's sysvinit program

2. Relink commands for reboot and shutdown

3. Determine which run scripts are required for Slackware that are not importable from Slackware's default init system.

4. Figure out how to get gettys 1-4 and 6 activated. Possibly /etc/inittab getty functions will need to be removed, edited, or commented out. Still trying to determine.

5. Sort out the bash error on login. Will post more details later on this.

6. Determine why runit-script fails to work and gives error.

For now If you wish to create any files, comment out the sections for the cat script generators (this will be arduous and I apologize) and simply make the scripts using a text editor as described.

I have no idea why the cat file creation tool is misbehaving, but I hope to solve this problem or else I'll have to release actual scripts I've generated. If anyone knows a remedy it will be appreciated.

I am currently drafting up a script set just in case, but I'm lacking webspace so until then I can't upload it anywhere really. I'm looking into some space from a friend so bare with me.
Attached Files
File Type: txt runit-script.txt (28.8 KB, 131 views)

Last edited by ReaperX7; 03-03-2014 at 06:56 PM.
 
Old 02-27-2014, 10:43 AM   #2
larryhaja
Member
 
Registered: Jul 2008
Distribution: Slackware 13.1
Posts: 305

Rep: Reputation: 80
We use runit at work but are moving away from it. We are now using upstart, which is much easier to use.

http://upstart.ubuntu.com/
 
Old 02-27-2014, 07:51 PM   #3
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
Small update posted. Despite the fact Runit works a little different from SysVInit, mostly running small work scripts, and a lot of symlinks to run scripts, I like the fact you can recycle sysv scripts without any real penalties. As posted above, I'm working on getting dependency scripting made, correctly mind you, especially for network daemons. Until I can get those properly drafted, anything for networks is being ran through rc.M-runit and rc.S-runit in linear loading mode. The rest are loaded in parallel for now. Still some hiccups and the reboot/shutdown is new to me, but so far so good.
 
1 members found this post helpful.
Old 02-28-2014, 01:59 PM   #4
bartgymnast
Member
 
Registered: Feb 2003
Location: Almere, Netherlands
Distribution: slack 7.1 till latest and -current, LFS
Posts: 368

Rep: Reputation: 165Reputation: 165
@ReaperX7,

Please add to your to do list, (long term goals)

Patches for slackware packages that uses hibernate/sleep mode (XFCE-power-manager)
Not sure if it currently works with runit. but the last git on XFCE has the systemd function build in for this.

I got no idea about KDE and systemd entanglement.

But patches might be required for other packages in slackware tree for future releases of slackware.
 
Old 02-28-2014, 02:43 PM   #5
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
Thanks Bart. I'll have to do a good bit of research on it, but Runit's shutdown and reboot are very basic commands which are mildly similar to sysvinit. I'm not entirely certain on the suspend/hibernate functions as right now the run scripts are in getting it working first stages. I'm also recycling a lot of the default rc-init scripts as well until I can get Runit scripts drafted correctly to for dependency loading.

I will say that this Runit implementation isn't going to possibly have ready made scripts and I'm looking at what could be a master script to generate all the files needed and link things on installation, but afterwards may be different. I'm not completely certain on my skills with the Slackware package creation methods yet, but gotta get my feet wet first.

I will say if anyone would like to help with creating a ready to use package, you're more than welcome to do so for this endeavor.

Edit:

Didn't make too much progress today at all.

Still lacking a proper shutdown script for Stage3. Thank God for JFS having good fail-safes otherwise I'd have a good bit of data loss on my end.

If anyone has any ideas on what I should use for a shutdown sequence, please let me know. I'm at a loss due to the fact Slackware doesn't use the sysvinit script for shutdown but rather it's own, so I can't import anything at the time.

Here's Stage 3's script, so if you have any ideas, post them please.

Code:
#!/bin/sh
exec 2>&1

PATH=/command:/sbin:/bin:/usr/sbin:/usr/bin

LAST=0
test -x /etc/runit/reboot && LAST=6

echo 'Waiting for services to stop...'
sv -w196 force-stop /service/*
sv exit /service/*

echo 'Shutdown...'
/etc/init.d/rc $LAST
I had thought about temporarily importing /etc/init.d/rc from LFS to work it somewhat, but didn't know how Slackware's scripts would react to it being there.

I do need a proper dismount of the file systems at LEAST.

Last edited by ReaperX7; 02-28-2014 at 06:23 PM.
 
Old 03-01-2014, 10:28 AM   #6
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
I'd say look at rc.6 from Slackware for a sane sequence to shutdown.
 
Old 03-01-2014, 11:11 AM   #7
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,057

Rep: Reputation: Disabled
Also, FYI here is the end of /etc/inittab in Slackware installer:
Code:
# Stuff to do before halting or rebooting.
# Hopefully it does these things in order, so that we can fake the
# system date one last time before umounting:
::shutdown:/bin/sh /sbin/fakedate
::shutdown:/sbin/swapoff -a >/dev/null 2>&1 
::shutdown:/bin/umount -a -r >/dev/null 2>&1 
::shutdown:/sbin/vgchange -an --ignorelockingfailure >/dev/null 2>&1 
::shutdown:/bin/sh /sbin/fixdate
The default inittab for busybox is here. Here "default" means how busybox works if there is no inittab at all.

Last edited by Didier Spaier; 03-01-2014 at 02:05 PM.
 
Old 03-02-2014, 03:38 PM   #8
turtleli
Member
 
Registered: Aug 2012
Location: UK
Posts: 206

Rep: Reputation: Disabled
What I did when I tried runit on a VM a few days ago was I changed the last line of the stage 3 script to
Code:
/etc/rc.d/rc.$LAST
so that the usual Slackware shutdown script would run. The filesystems should be cleanly dismounted that way.
 
1 members found this post helpful.
Old 03-02-2014, 03:48 PM   #9
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
Thanks Turtleli, I'll test it tonight. Then see about the rest of the Slackware script sets.

Next goal is to get the Gettys working on tty1-4 and 6, I might need to adjust inittab from agetty to getty. I'm also removing rc.S-Runit and rc.M-Runit and attempting to migrate linear loads directly into stage1 and stage2.

Last edited by ReaperX7; 03-02-2014 at 03:51 PM.
 
Old 03-03-2014, 04:24 PM   #10
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
Major update above in main article, please read.
 
Old 03-17-2014, 03:15 PM   #11
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
Made some progress today in getting the getty services working to proper order.

[Updates]

1. Switched back to agetty and modified some scripts to run similar to how syvinit's inittab lists them. TTY1~6 all work now so login can be properly done. AWESOME!!!

2. Got runit rebuilt with dietlibc. This reduced the program size a bit. I may not actually use this in the end, but it was just somethign to try out.

3. Imported Gerrit Pepe's socklog and ipsvd programs. Need to possibly draft a SlackBuild for this as I did a rough standard install. May leave these optional.

4. Got a few barebones scripts working after researching some methods used by LFS-Runit. Other service daemons are still being ran off rc.M and rc.S for now. Once more service run scripts can be made I'll wean rc.M and rc.S down to the bare minimum, or swap them out for the regular rc scripts.

5. Switched out the location of the service scripts to /etc/runit with symlinks now pointing to /var/services rather than /etc/sv directory pointing symlinks back to /etc/runit.

6. Completed transition to runit and backed up sysvinit/bsdinit programs and service scripts. System now directly controlled from Runit.

[To-Do-List]

1. System still complains of "No Job Control in this Shell", but after reading some reports from Debian and other distributions, this is actually a known problem long standing with GNU/Linux and Bash oddly. No idea why. I'll see what's causing this or if a fix can be made, if possible, but this is not vital.

2. Draft more scripts and setup service handlers and dependency service handlers. I downloaded some run scripts used by ArchLinux for it's Runit setup and have a better idea of how to set this up properly.

3. Complete script set and draft up an installation package for booting with Runit.

4. Create scripts to perform shutdown and reboot functions with script to execute reboot (init 6) and shutdown (init 0)

This script up at the first post is now deprecated so don't bother downloading and using it. I'm going to have a new script posted soon.

As of today, and since this init has been tested to work well, I'd like to put this out there. If anyone knows of any webspace that you can allocate, even if FTP only, I'd be appreciated. I don't have a time table to finish this yet, but I aim to have enough scripts and the installation script drafted within a month or two.

Last edited by ReaperX7; 03-17-2014 at 11:20 PM.
 
Old 03-17-2014, 03:45 PM   #12
moisespedro
Senior Member
 
Registered: Nov 2013
Location: Brazil
Distribution: Slackware
Posts: 1,223

Rep: Reputation: 195Reputation: 195
Maybe host it at github?
 
Old 03-17-2014, 05:51 PM   #13
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'll have to see first, but thanks for the suggestion.

Found this on Gentoo's forum.

There's a line in /etc/profile that reads:

alias su="su -c 'bash -l'"

which, if commented out, or removed, stops the "No Job Control..." warning. Will check for it, and if applicable, try it out later.

I'd like to add that this has been a good learning experience for me into how GNU/Linux operates at some of the lowest levels and how software interacts with the underlying services and subsystems.

Last edited by ReaperX7; 03-17-2014 at 11:23 PM.
 
1 members found this post helpful.
Old 06-01-2014, 09:23 AM   #14
san2ban
Member
 
Registered: May 2013
Location: Bengaluru / India
Distribution: Slackware14.2-64bit on one HDD, Slackware64-current on anotherHDD, VoidLinux on Libreboot laptop
Posts: 169

Rep: Reputation: Disabled
ReaperX7

Since I am not a coder / programmer, eagerly waiting for your work to be completed, so that I can implement it on my system
 
1 members found this post helpful.
Old 06-01-2014, 10:39 AM   #15
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've switched my focus currently to Runit for LFS (without sysvinit) but the work is available for porting to Slackware with the proper script edits and the proper service scripts. You could even dare import the recycled sysvinit scripts into Slackware from B/LFS and use them. Either way, the work is there if you want to use it.
 
  


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
[SOLVED] S6 or Runit, not systemd san2ban Slackware 33 12-16-2017 06:29 PM
Runit dbus and hald xaos5 Debian 3 11-22-2007 04:21 AM
runit on SuSE 10.1 tzbishop SUSE / openSUSE 2 10-09-2006 11:26 AM
runit problems deroB Linux - Software 3 01-17-2006 02:40 PM
xdm with runit? behmjose Linux From Scratch 0 05-22-2004 03:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:56 PM.

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