It's because I get crazy when I have to type one milion times per day cd /etc/rc.d/--bla--bla-- or just execute the startup script with the absolute path which is even more exhaustive.
### daemon - lists and starts scripts from /etc/rc.d ### may be useful under Slackware use strict; my $rc_dir = q|/etc/rc.d|; my @coms = grep {-f && -x} glob "$rc_dir/*"; my %coms; my $com; @coms = grep{/.{2,}/} map {s|.+/rc\.(.+?)\W*$|$1| and $_} @coms; $" = $/ and die "@coms", $/ unless @ARGV; $com = shift; @coms{@coms} = (); exists $coms{$com} or die qx{"$rc_dir/rc.$com"},$/; print for qx{"$rc_dir/rc.$com" "@ARGV"};

__END__
#cp daemon.pl /usr/bin/daemon; chmod +x !$
#daemon sshd start (or restart or whatever args /etc/rc.d/rc.sshd script takes)


Replies are listed 'Best First'.
Re: startup scripts under Slackware
by gellyfish (Monsignor) on Jun 11, 2006 at 19:47 UTC

    See also chkconfig.pl which, whilst it doesn't actually run the programs, allows you to manipulate "system services" that are run in the SysV init style.

    /J\

Re: startup scripts under Slackware
by ruzam (Curate) on Jun 12, 2006 at 00:03 UTC
    Redhat based systems have a bash script called 'service' that performs this task (including many more checks). It's a pretty basic system admin tool that's been around for ages. Are you saying that Slackware doesn't have an equivalent?
      Exactly. You might say Slackware doesn't really need one.

      All scripts live in /etc/rc.d/ - there are no other directories containing symlinks, no Sdd or Kdd scripts, nada. We get an rc.S (for single user, or runlevel 1), an rc.M (multiuser, or runlevel 3), an rc.4 that launches (x|g|k)dm, an rc.6, an rc.K, and other daemon scripts like rc.httpd, rc.mysqld, rc.inetd, rc.samba, rc.sshd, etc.

      --
      jpg
Re: startup scripts under Slackware
by ForgotPasswordAgain (Vicar) on Jun 11, 2006 at 16:20 UTC
    Wouldn't putting /etc/rc5.d/ or whatever in your $PATH be easier?
      How can it be when you'll not be able to take a list of all exec-s and also - how portable will it be?