Jump to content

autostart ups drivers in root?


Recommended Posts

I appologize because I think I have asked this before and not noted it down.

Belkin has 2 driver programs that need to be started up with root proviliges. I did hang them in user autostart but that's getting old as it likes to start 2 of them when I log into root and that, while amusing, is not useful.

I think I should (?) put them somewhere in /etc/rc#.d where # is 1, 2, or 3

 

I think this is right and can I put them in in such a way that they don't ask for a password.

tia!

Kristi

 

[moved from Software by spinynorman]

Link to comment
Share on other sites

Well, actually, if you're going to do it that way, you need to write a little script which will run them when called with 'start', stop them when called with 'stop', and restart them when called with 'restart'. If it told you what they were doing when called with 'status', that'd be a bonus. Then you put *that* script in /etc/init.d , and create two symlinks to it in /etc/rc5.d. The first would be named something like S50script and the second something like K50script. The symlink that starts with 'S' would be called with 'start' when the system was booting, and the one that starts with 'K' would be called with 'stop' when the system was shutting down. The numbers would indicate the order within the boot process; the scripts in /etc/rc*.d all have one of these numbers, and they're started and stopped in numerical order.

 

This is how the init sequence works, and it's likely a little more engineering than you want to do to just start a couple of little things on boot :). If you don't want to bother with it all, don't mess up the /etc/init.d/ and /etc/rc.d/ directories with incorrect stuff; instead just put the commands in /etc/rc.local . I think this is run with root privileges, so it should be fine. Just be aware they won't get shut down automatically on system shut down, if that's a problem.

Link to comment
Share on other sites

Just got back from a bunch of errands - thanks to both of you!

 

Hey - neat new KDE3.4 background (I musta just updated! - duh!)

Also the menu is very tall now - gotta figure out how to knock it down to size (heehee)

 

Okay - just looked at /etc/rc#.d - had forgotten that they were shells. That wouldn't be too big a deal - a one liner for each, but I had forgotten about the "K" and "S" bit - the K would be easily and I guess I would just ignore the S (operationally, I do that anyway. There is a way in the monitor to tell it to shutdown, but that would be having Belkin power off instead of Linux. Bad Belkin! - Normally when there is a power outage (1:30AM - another NSTAR "upgrade", once a month), I am sitting at the computer and shut things, including Mandriva, gracefully. Belkin will do it auto if I'm not there, I hope!!!

 

Anyway, all I "need" is to put /usr/local/bulldog/upsd in /etc/rc.local, and make sure it is root executable which it was. I took both of them out of my user autostart, and tried adding a link to /usr/local/bulldog/monitor with user, not root permissions, and it worked beautifully. upsd takes a while to start as it sets up a "network" where it's the "master", and its just about ready to send info to monitor when monitor gets started in user. Is it possible to put a 5 sec delay in front of monitor starting?

 

So anyway, thanks to papaschtroumpf, even though I went Adam's route (thanks Adam!!!)

 

I also did not know if, in Mandriva2006, everything goes through 1, or 2, or 3, if it is going to be run in 3 or 5 ? I know a 3 will do the 3 and a 5 will do the 5, but that's all. I don't think a 5 will do a 4 because it goes directly from 3 to 5. Or am I more in a fog than I think.

tia

Kristi

Edited by kristi
Link to comment
Share on other sites

kristi: just add a 'sleep' command before the monitor command, something like 'sleep 5; monitor' should do it (uh, I think seconds are the default units for sleep commands, anyway).

 

The levels aren't additive. Whichever level you're at, that level's /etc/rcX.d is used, and the other directories are completely ignored. The system has a default level that is used at boot time, and you switch using the 'init' or 'telinit' command. By convention, level 1 is single-user mode, level 3 is normal initialisation to a console, and level 5 is normal initialisation to a graphical desktop. MDV implements these three levels. The only major difference between level 3 and level 5, which you can see by just examining /etc/rc3.d and /etc/rc5.d, is that the services dm and xfs are started in level 5 but not in level 3. 'dm' starts up X and 'xfs' starts the X font server, so this matches the definitions. Levels 2 and 4 are generally not used, don't worry about them.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...