LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   POSIX-compatible rc.init scripts for Slack (13.0+) (https://www.linuxquestions.org/questions/slackware-14/posix-compatible-rc-init-scripts-for-slack-13-0-a-778084/)

gnashley 10-20-2010 03:38 PM

Okay, I put in some more time on the README to get this ready today(night here). I've uploaded everything here:
http://distro.ibiblio.org/pub/linux/...sysvinit-dash/

@Sasha - Of *course* you'll find 'nifty tricks' in my code -or maybe not... My work is not intended to replace /bin/sh with /bin/dash. Way too much misery in that for me. My 'distro' -I've mentioned that to you before, but I've (once again) abandoned the idea. It's simply more work than I want to take on -I'm seem to be a cold-weather-only coder, so it would be unfair to any potentil users to lead them astray... I did manage to get a rather-complete set of src2pkg scripts made for most of the basic
packages needed for a system -including X and many optional packages. after some cleanup I'll be uploading them to my site(this fall) for any use they may be to others. There's some pretty interesting stuff there, including my glibc build scripts which create a couple of hundred individual locale packages and my scripts for building X using src2pkg for the most tedious parts...
src2pkg taught me that by working on individual programs I could have more 'impact' than by trying to maintain a whole distro.

@ H_TexMex_H - You can find a src2pkg build of dash here:
http://distro.ibiblio.org/pub/linux/....0/dash-5.5.1/
If you (oh so bravely) decide to build my version of the scripts (using src2pkg) and (really, really bravely) install the package, the scripts should work even if you don't have dash or ash installed -but of course with little result. I put a lot of effort into the doinst.sh so that installing the package would work whether (or not) ash or dash are installed. If you want to use dash, you should have it installed first before installing my scripts. The dash executable should be at /bin/dash, not at /usr/bin/dash (/usr may not be mounted until well into the boot scripts)

I've written a really looonnnngg README here:
http://distro.ibiblio.org/pub/linux/...it-dash/README
which gives valuable insight into my approach to this idea. It is a must-read if you plan to use any of my material. It may also give much-less-valuable insight into any number of other things -if you read between the lines! :=) Happy re-booting...

GrapefruiTgirl 10-20-2010 04:59 PM

@ gnashley,

your README is very nice - and I already learned a little thing or two from it. I plan to go through it again piece by piece to specifically address or comment on some points you made in there, but ultimately you pretty much covered the situation in good detail so that anyone wondering "what it's all about" now has a very good idea if they read your README.

Thanks again for your interest & work on this, and also for hosting all these files at your location. :)

gnashley 10-21-2010 12:08 PM

Hmmm, Jeremy said that no posts had been lost, but my reply here from yesterday eveneing and someone else's reply to that are not here.
So, I'll repeat -but more briefly.
I've uploaded my sources and src2pkg build scripts here:
http://distro.ibiblio.org/pub/linux/...sysvinit-dash/

There's a pretty long README here:
http://distro.ibiblio.org/pub/linux/...it-dash/README

gnashley 10-21-2010 12:08 PM

Oh weird, now my posts from yesterday show up here. Opera weirdness(rare).

H_TeXMeX_H 10-21-2010 12:58 PM

Alright thanks, well maybe this weekend, when I'm feeling lucky and brave, I may try them.

gnashley 10-22-2010 03:55 AM

@H_TeXMeX_H - on second thought, I think you'd best *not* try building and installing my scripts on Slackware. My packages follow a different naming convention and the way the files are distributed between the packages (sysvinit and sysvinit-scripts) may not fit with what Slackware is presently doing -you might have to manually overwrite and/or remove files in order to restore your system. A better bet would be to wait and see what Sasha does -hopefully she'll come up with a clean way to be able to install/upgrade/downgrade the scripts without braking anything. At the moment I don't have time to test/rewrite to make sure they would work on Slackware.

@Sasha -It's well worth looking closely at tuvdev's scripts for style/compliance pointers. He's formally studied shell programming and follows pretty strict practices which make very good examples which are not likely to lead you astray.

GrapefruiTgirl 10-22-2010 11:01 AM

UPDATE..

Well, I've re-gone-through all my scripts in /etc/rc.d but I know I have a few more around the system that I'll have to take a fresh look at. Had a period of time yesterday where I couldn't boot past "Starting HALd" (because it wouldn't start because UDEV hadn't been started and so /dev was sparse) but have that sorted now.

You know what's horrible? /sbin/rescan-scsi-bus. It's a printf/echo and variable-typing pain, although gnashley's version works nicely (some tests make me wonder *how* it's working without complaint). I managed to bork that version for a while too (while editing some of it to my own style & taste) but seem to have it working well now. I'm still tempted to toss out a lot of the verbose output away.

I've had a look at some of tuxdev's scripts; the biggest change I've seen so far is in rc.4, and I have yet to take another look at it, but I thought there was some extra code there too (hard to imagine, it's been compacted so nicely).

Tra la la, on with the show!

GazL 10-22-2010 11:25 AM

I did something very similar with my rc.4 a while back:
Code:

#! /bin/sh
#
# rc.4          This file is executed by init(8) when the system is being
#              initialized for run level 4 (XDM)
#

echo "Starting X11 Display Manager..."

# Feel free to alter the search order to suit your preference.

for manager in \
    /usr/bin/kdm \
    /usr/bin/xdm \
    /usr/bin/gdm \
    ;
  do
    test -x $manager && exec $manager -nodaemon
  done

# exec means we should never get this far, unless there's no
# binary to run.

echo "rc.4: Cannot find usable Display Manager binary" >&2

Similar approach to Tuxdev's so clearly we were thinking along similar lines, but it doesn't use a variable and that push_back() function for the list of display manager binaries, which makes it a little bit simpler.

GrapefruiTgirl 10-22-2010 11:49 AM

I like your approach the most GazL. Very simple, and super easy to add/remove DM's from; would be ideal as the default rc.4 in Slackware. :cool:


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