LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 05-14-2015, 05:10 AM   #1
aaditya
Member
 
Registered: Oct 2013
Location: India
Distribution: Slackware
Posts: 161
Blog Entries: 2

Rep: Reputation: Disabled
Using OpenRC on Slackware


OpenRC is a dependency based init system that works with the system provided init program, normally /sbin/init.

Installation procedure and more information about it available here.
 
Old 05-14-2015, 03:52 PM   #2
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-Current
Posts: 6,444
Blog Entries: 15

Rep: Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013
There's actually a project also that imported OpenRC as a full package as well.

https://github.com/w41l/wlsbuild/tree/master/openrc

The author, if it is him, wrote an article on it:

http://www.walecha.web.id/blog/2015/...-dengan-openrc

Both projects are good efforts. Might try it out soon.

Last edited by ReaperX7; 05-14-2015 at 04:00 PM.
 
1 members found this post helpful.
Old 05-19-2015, 11:10 AM   #3
aaditya
Member
 
Registered: Oct 2013
Location: India
Distribution: Slackware
Posts: 161

Original Poster
Blog Entries: 2

Rep: Reputation: Disabled
Just to avoid confusion, the SlackBuilds mentioned by ReaperX7 in the post above are from a different author and predate my efforts.

My SlackBuilds can be found here.

Last edited by aaditya; 05-19-2015 at 11:11 AM.
 
2 members found this post helpful.
Old 05-19-2015, 06:12 PM   #4
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-Current
Posts: 6,444
Blog Entries: 15

Rep: Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013
Ah thank you.

Do you have a git or svn of the collective work?

Update:

I got OpenRC working with a few modifications of my own. Wasn't easy. A few hiccups, like NetworkManager not cooperating (nothing new as I had issues with it on Runit being a PITA), and Parallel mode seems to be limited due to the way the dependencies are resolved in the scripts (I'm checking this against Funtoo's OpenRC scripts to see what I can optimize), but so far... not too bad.

One thing is for certain, work still is needed to clean up many dependencies in the trees for parallel, but overall it works, and actually stays out of the way.

Last edited by ReaperX7; 05-20-2015 at 03:25 AM.
 
Old 05-20-2015, 07:24 AM   #5
aaditya
Member
 
Registered: Oct 2013
Location: India
Distribution: Slackware
Posts: 161

Original Poster
Blog Entries: 2

Rep: Reputation: Disabled
Quote:
Originally Posted by ReaperX7 View Post
Ah thank you.

Do you have a git or svn of the collective work?

Update:

I got OpenRC working with a few modifications of my own. Wasn't easy. A few hiccups, like NetworkManager not cooperating (nothing new as I had issues with it on Runit being a PITA), and Parallel mode seems to be limited due to the way the dependencies are resolved in the scripts (I'm checking this against Funtoo's OpenRC scripts to see what I can optimize), but so far... not too bad.

One thing is for certain, work still is needed to clean up many dependencies in the trees for parallel, but overall it works, and actually stays out of the way.
Dunno why NetworkManager did not work at your end, seems to work here.

The scripts are sourced from the gentoo packages and placed in a git repository. Any modification that is necessary is done at install time by the install* scripts.

Source: https://bitbucket.org/aadityabagga/openrc-services/src

Original source: https://sources.gentoo.org/cgi-bin/v...gi/gentoo-x86/
 
Old 05-20-2015, 10:05 AM   #6
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-Current
Posts: 6,444
Blog Entries: 15

Rep: Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013
NetworkManager is finicky as it is. I did get dhcpcd working better. I'm going to keep at it to see how it goes. This software seems interesting.

Some small suggestions:

1.) In /etc/inittab, you should change this:

Code:
# TERMINALS
c1:12345:respawn:/sbin/agetty 38400 tty1 linux
To this:

Code:
# TERMINALS
c1:12345:respawn:/sbin/agetty 38400 tty1 --noclear linux
This leaves the boot text intact for last minute reviews when starting from the Console rather than X.

2.) The iptables scripts need to point to /usr/sbin rather than /sbin for the iptables tools.

3.) You also should assign the following to boot: fuse, udev, udev-postmount, sysklogd, and alsasound

You should add these to default: consolekit, sshd, acpid, atd (and NetworkManager or dhcpcd)

These, by default, are enabled in Slackware natively with the bsd-scripts.

4.) Check the /path/to of each init script if they have any absolute path entries. Usually this can be solved by exporting a path sequence setting:

Code:
export PATH=/bin:/sbin:/usr/bin:/usr/sbin
per script. This will greatly simplify path resolving for scripts trying to execute binaries.

Otherwise.... Aaditya... This is way too cool. Love it. Love it. Love it.

You should push this to SlackBuilds.org (pending my suggestions).

Last edited by ReaperX7; 05-21-2015 at 06:51 AM.
 
3 members found this post helpful.
Old 05-21-2015, 06:44 AM   #7
aaditya
Member
 
Registered: Oct 2013
Location: India
Distribution: Slackware
Posts: 161

Original Poster
Blog Entries: 2

Rep: Reputation: Disabled
Quote:
Originally Posted by ReaperX7 View Post
NetworkManager is finicky as it is. I did get dhcpcd working better. I'm going to keep at it to see how it goes. This software seems interesting.

Some small suggestions:

1.) In /etc/inittab, you should change this:

Code:
# TERMINALS
c1:12345:respawn:/sbin/agetty 38400 tty1 linux
To this:

Code:
# TERMINALS
c1:12345:respawn:/sbin/agetty 38400 tty1 --noclear linux
This leaves the boot text intact for last minute reviews when starting from the Console rather than X.

2.) The iptables scripts need to point to /usr/sbin rather than /sbin for the iptables tools.

3.) You also should assign the following to boot: fuse, udev, udev-postmount, sysklogd, and alsasound

You should add these to default: consolekit, sshd, acpid, atd (and NetworkManager or dhcpcd)

These, by default, are enabled in Slackware natively with the bsd-scripts.



Otherwise.... Aaditya... This is way too cool. Love it. Love it. Love it.

You should push this to SlackBuilds.org (pending my suggestions).
1. Instead of editing inittab, I guess /etc/rc.conf could be edited to set RC_LOGGER=yes, this way the boot logs could be stored in /var/log/rc.log (by default) and retrieved later when required.

2. Corrected.

3. I think I will leave it upto the user to decide which services they want to start, some common ones are listed in the README as well as in the article on docs.slackware.org.

Thx for the feedback
 
1 members found this post helpful.
Old 05-21-2015, 06:55 AM   #8
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-Current
Posts: 6,444
Blog Entries: 15

Rep: Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013
I added a 4th, but regardless, udev and udev-postmount are needed for hardware detection. The rest are trivial, but this could be added into the README.Slackware for noting.

Otherwise, this is shaping up rather nicely.

Last edited by ReaperX7; 05-21-2015 at 07:00 AM.
 
Old 05-21-2015, 07:58 AM   #9
aaditya
Member
 
Registered: Oct 2013
Location: India
Distribution: Slackware
Posts: 161

Original Poster
Blog Entries: 2

Rep: Reputation: Disabled
Quote:
Originally Posted by ReaperX7 View Post
I added a 4th, but regardless, udev and udev-postmount are needed for hardware detection. The rest are trivial, but this could be added into the README.Slackware for noting.

Otherwise, this is shaping up rather nicely.
I was able to boot up my system without the udev service (udev-postmount is used with eudev I think).

I booted up an old copy of System Rescue CD that I had and which uses OpenRC, and udev was in the sysinit runlevel.

From my limited understanding, the services in sysinit runlevel get started first, followed by those in boot and then in default.

Last edited by aaditya; 05-26-2015 at 08:29 AM. Reason: correct order, from boot -> sysvinit ->default to sysinit ->boot -> default
 
Old 05-21-2015, 10:33 AM   #10
aaditya
Member
 
Registered: Oct 2013
Location: India
Distribution: Slackware
Posts: 161

Original Poster
Blog Entries: 2

Rep: Reputation: Disabled
After some introspection and looking at the enabled services in the System Rescue CD, I decided to enable the following services by default by adding them to the sysinit runlevel: udev, udev-postmount, and kmod-static-nodes.

SlackBuild updated with above changes.

Also, users who use dmcrypt, lvm, or mdraid could add the following services respectively to the boot runlevel:
Code:
# rc-update add dmcrypt boot        # dmcrypt
# rc-update add device-mapper boot  # lvm
# rc-update add lvm boot            # lvm
# rc-update add mdraid boot         # mdraid

Last edited by aaditya; 05-21-2015 at 11:13 AM.
 
Old 05-21-2015, 04:49 PM   #11
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-Current
Posts: 6,444
Blog Entries: 15

Rep: Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013
Although not really a target goal, parallel mode with dependency enforcement enabled boots my system up in about 7 seconds.

Another needed fix, nvidia-persistenced, if I'm not mistaken, is located in /usr/bin rather than /opt/bin (actually this script is not installed but is useful so adding it to the install list might be wise). Same as nvidia-smi and nvidia-settings for the path fixes. The ati drivers might be in the same /usr/sbin directory listing.

Lastly, the other OpenRC project has some scripts for fontcache, ldconfig, glibschema, iconcache, and gtkmodules. (These work well to keep the system themes, cache, etc. up to date.) Importing these might be a good idea.

Package is stable here, so, hopefully you can get this up on SBo.

Last edited by ReaperX7; 05-21-2015 at 10:34 PM.
 
Old 05-21-2015, 10:53 PM   #12
aaditya
Member
 
Registered: Oct 2013
Location: India
Distribution: Slackware
Posts: 161

Original Poster
Blog Entries: 2

Rep: Reputation: Disabled
Quote:
Originally Posted by ReaperX7 View Post
Although not really a target goal, parallel mode with dependency enforcement enabled boots my system up in about 7 seconds.

Another needed fix, nvidia-persistenced, if I'm not mistaken, is located in /usr/bin rather than /opt/bin (actually this script is not installed but is useful so adding it to the install list might be wise). Same as nvidia-smi and nvidia-settings for the path fixes. The ati drivers might be in the same /usr/sbin directory listing.

Lastly, the other OpenRC project has some scripts for fontcache, ldconfig, glibschema, iconcache, and gtkmodules. (These work well to keep the system themes, cache, etc. up to date.) Importing these might be a good idea.

Package is stable here, so, hopefully you can get this up on SBo.
Added nvidia-persistenced and changed the path for it as well as nvidia-smi, I dont use it so I dont know if it works though...

For ati I dont see a package in SBo, so I guess I will not change the path for that.

I could not find the files for fontcache, ldconfig, glibschema, iconcache or gtkmodules, if you can locate them I could add them. As an alternative one could create a script for them in the /etc/local.d directory (see /etc/local.d/README for more details), by copying the relevant portions from /etc/rc.d/rc.M.

I think I will wait another week before submitting to SBo to see if more bugs can be discovered and fixed

Last edited by aaditya; 05-21-2015 at 10:56 PM.
 
Old 05-21-2015, 11:07 PM   #13
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-Current
Posts: 6,444
Blog Entries: 15

Rep: Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013
I have the URLs here (I forgot about mimedatabase):

https://github.com/w41l/wlsbuild/blo...it.d/fontcache
https://github.com/w41l/wlsbuild/blo...d/mimedatabase
https://github.com/w41l/wlsbuild/blo...nit.d/ldconfig
https://github.com/w41l/wlsbuild/blo...it.d/iconcache
https://github.com/w41l/wlsbuild/blo...t.d/gtkmodules
https://github.com/w41l/wlsbuild/blo....d/glibschemas

These should help.

Also, on a side note for anyone interested:

To combat the problem of using bsd-style init or OpenRC with packages, I added a small tool inside my SlackBuild scripts at SlackWorks such as follows:

Code:
if [ -d /etc/rc.d ]; then
  mkdir -p $PKG/etc/rc.d
  cat $CWD/rc.consolekit > $PKG/etc/rc.d/rc.consolekit.new
  chmod 0755 $PKG/etc/rc.d/rc.consolekit.new
fi
This autodetects the init system in usage (whether it be sysvinit or OpenRC) and does or doesn't create the appropriate system directory as needed to avoid unneeded scripts being placed in the wrong directories.

A similar trigger will be needed in doinst.sh as well, but this does work very effectively.

This might be useful for any package using a custom init script for Slackware.

Also, due to the fact there are things being loaded from the schemas and cache being updated, the boot process will take longer than normal, but on average with everything going, my boot time is about 35-55 seconds depending on what I have enabled for boot time.

Honestly, everything is working, minus ip6tables, which is probably a kernel issue, but overall it works well enough to be release worthy.

I would make sure all the init scripts that are usable by Linux are installed.

Aaditya, you have done well and wisely. Pat yourself on the back kiddo, you just brought Slackware an alternative and completed init system.

Last edited by ReaperX7; 05-22-2015 at 12:15 AM.
 
Old 05-22-2015, 01:08 AM   #14
aaditya
Member
 
Registered: Oct 2013
Location: India
Distribution: Slackware
Posts: 161

Original Poster
Blog Entries: 2

Rep: Reputation: Disabled
Quote:
Originally Posted by ReaperX7 View Post
I have the URLs here (I forgot about mimedatabase):

https://github.com/w41l/wlsbuild/blo...it.d/fontcache
https://github.com/w41l/wlsbuild/blo...d/mimedatabase
https://github.com/w41l/wlsbuild/blo...nit.d/ldconfig
https://github.com/w41l/wlsbuild/blo...it.d/iconcache
https://github.com/w41l/wlsbuild/blo...t.d/gtkmodules
https://github.com/w41l/wlsbuild/blo....d/glibschemas

These should help.

Also, on a side note for anyone interested:

To combat the problem of using bsd-style init or OpenRC with packages, I added a small tool inside my SlackBuild scripts at SlackWorks such as follows:

Code:
if [ -d /etc/rc.d ]; then
  mkdir -p $PKG/etc/rc.d
  cat $CWD/rc.consolekit > $PKG/etc/rc.d/rc.consolekit.new
  chmod 0755 $PKG/etc/rc.d/rc.consolekit.new
fi
This autodetects the init system in usage (whether it be sysvinit or OpenRC) and does or doesn't create the appropriate system directory as needed to avoid unneeded scripts being placed in the wrong directories.

This might be useful for any package using a custom init script for Slackware.
The above look custom made, I was looking more for Gentoo provided ones.

Also, as these services are mostly oneshot, I think they are more appropriate as a script in /etc/local.d. So I added rcM.start, which will be installed but will be not be enabled by default. To enable it one can do:

Code:
# chmod +x /etc/local.d/rcM.start
openrc-services SlackBuild updated with this change.

Last edited by aaditya; 05-22-2015 at 01:14 AM.
 
Old 05-22-2015, 09:57 PM   #15
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-Current
Posts: 6,444
Blog Entries: 15

Rep: Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013Reputation: 2013
Testing well so far. No problems found.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
OpenRC ReaperX7 Linux From Scratch 11 03-08-2015 08:34 PM
[SOLVED] Can't start NFS with systemd, works on OpenRC TobiSGD Linux - Server 1 07-09-2014 03:53 PM
LFS with OpenRC? ReaperX7 Linux From Scratch 5 08-13-2013 09:29 PM
SysVinit vs OpenRC vs systemd vs other init system cristi92b Linux - Newbie 2 01-07-2013 04:02 AM
/bin/* : cannot execute binary file (and an openrc problem) [gentoo] namish Linux - Newbie 6 04-07-2012 02:49 PM

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

All times are GMT -5. The time now is 01:07 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration