LinuxQuestions.org
Help answer threads with 0 replies.
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-22-2006, 12:18 AM   #1
emil+
LQ Newbie
 
Registered: Feb 2006
Posts: 21

Rep: Reputation: 15
.. how to put a script to '/etc/rc.d/rc.*?


Hi!

someone knows how to make a program (in '/etc/rc.d/..') runnable, without writing to '../rc.local'.

For example 'rc.cupsd' which is listed there too started automatically at boot, if i try the same with that script called, 'rc.postfix' with equal rights like 'rc.cupsd' -> '755' nothing happens by starting the computer.

So i remember i had red by given' that command 'chmod -x <script>' it will be kept from starting at boot, so i thought the other way '+x' will put it at boot.

[" The command:

chmod -x /etc/rc.d/filename

will keep scripts from running at start time. Keep only what you need, the rest is just weighing you down." from: "Welcome to My Slackware Site".]

Cheers --user_tom
 
Old 02-22-2006, 12:52 AM   #2
baldwonder
Member
 
Registered: Sep 2004
Location: Florida
Distribution: Slackware, VectorLinux, FreeBSD,Xubuntu
Posts: 69

Rep: Reputation: 15
to make a program executable, you are correct in using "chmod +x filename". But to get Slackware to recognize the script and run it, you have to tell it to do so. The easiest way is to edit rc.local and add the script in there with something like:
Code:
if [ -x /etc/rc.d/rc.myscript ]; then
   /etc/rc.d/rc.myscript
fi
It checks to see if rc.myscript is executable and if so, it executes it. I know you didn't want a solution where you had to write to rc.local, but I'm not sure if there is another way.
 
Old 02-22-2006, 12:53 AM   #3
jonthelam
Member
 
Registered: Jul 2004
Location: Southern California
Distribution: Slackware 10
Posts: 61

Rep: Reputation: 16
Try this:

Code:
chmod a+x /etc/rc.d/filename
 
Old 02-22-2006, 01:30 AM   #4
ArmOrAttAk
Member
 
Registered: May 2005
Location: NYC
Distribution: Slackware, Gentoo
Posts: 30

Rep: Reputation: 15
It's not a bad idea to browse your /etc/rc.d/rc.* files to see what's going on.
 
Old 02-22-2006, 04:03 AM   #5
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,467

Rep: Reputation: Disabled
What I did was make an rc.custom file in rc.d, make it executable +x, and put

if [ -x /etc/rc.d/rc.custom ]; then
/etc/rc.d/rc.custom
fi

in rc.local.

Then you only have to add things to the custom file
 
Old 02-22-2006, 07:42 AM   #6
emil+
LQ Newbie
 
Registered: Feb 2006
Posts: 21

Original Poster
Rep: Reputation: 15
... thanks a lot for response!

user_tom
 
Old 02-23-2006, 11:27 AM   #7
emil+
LQ Newbie
 
Registered: Feb 2006
Posts: 21

Original Poster
Rep: Reputation: 15
... maybe for someone is useful;

This Hint from "jonthelam" has taken what i want.

I don't know why, because there is no process (i have found) with 'master postfix' or 'sendmail', although emails come home!

.. thank you a second time!

user_tom
 
Old 02-23-2006, 01:38 PM   #8
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,467

Rep: Reputation: Disabled
sendmail is started in rc.M. Don't know about postfix tho
 
Old 02-23-2006, 10:51 PM   #9
emil+
LQ Newbie
 
Registered: Feb 2006
Posts: 21

Original Poster
Rep: Reputation: 15
Dive,

have you the pleasure to translate what it means 'rc.M' and '...tho', so

so a newbie like me could understand what it means!

i would be thankfully

user_tom
 
Old 02-23-2006, 11:01 PM   #10
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,940

Rep: Reputation: 129Reputation: 129
The file /etc/rc.d/rc.M ...

Code:
bruce@silas:~$ less /etc/rc.d/rc.M
#!/bin/sh
#
# rc.M          This file is executed by init(8) when the system is being
#               initialized for one of the "multi user" run levels (i.e.
#               levels 1 through 6).  It usually does mounting of file
#               systems et al.
#
# Version:      @(#)/etc/rc.d/rc.M      2.23    Wed Feb 26 19:20:58 PST 2003
#
# Author:       Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
#               Heavily modified by Patrick Volkerding <volkerdi@slackware.com>
#

# Tell the viewers what's going to happen.
echo "Going multiuser..."
<snip>
And "tho" would be a vernacular or slang for "though".
 
Old 02-24-2006, 02:17 PM   #11
emil+
LQ Newbie
 
Registered: Feb 2006
Posts: 21

Original Poster
Rep: Reputation: 15
... so i'm in the picture;

sorry, but i'm german.
 
Old 02-24-2006, 02:27 PM   #12
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,467

Rep: Reputation: Disabled
It's ok - it's a bad habit I picked up from our American cousins - tho = though, thru = through etc
 
  


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
Bash put script jnusa Programming 3 09-07-2004 02:31 AM
Where to put iptables script? tentolga Linux - Networking 9 08-28-2004 07:39 AM
PPPD how do I know what to put in the script? jimdaworm Slackware 4 02-29-2004 12:02 PM
Where to put program/script cmfarley19 Linux - General 5 02-26-2004 01:23 PM
How & where to put script? snakedriver Linux - Newbie 2 01-21-2004 07:11 PM

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

All times are GMT -5. The time now is 06:41 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