LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 05-29-2008, 04:32 PM   #1
nonsense28sal
Member
 
Registered: Mar 2005
Location: USA - Oxford, Mississippi
Distribution: Kubuntu-Gutsy, SuSE, Mandriva, Debian
Posts: 89

Rep: Reputation: 15
Belkin serial UPS's agent does not start automatically at boot


Hi All.

I recently bought a Belkin F6C900-UNV 900VA dual serial/USB UPS. I'm using the serial connection and everything seems to be working fine under Ubuntu Server 8.04. The java based software provided by Belkin works fine. The one problem is the agent program that monitors the UPS does not automatically start at boot. I'm trying to figure out how to write a script that will initialize it at boot so I do not have to start it manually. To start the agent manually I change over to the install directory:

Code:
cd /opt/upspilot
and type:

Code:
./agent start
I tried making a symbolic link in /etc/rc2.d with:

Code:
sudo ln -s /opt/upspilot/agent start S99upsagent
but that gives me:

Quote:
ln: target `S99upsagent' is not a directory
Any ideas on how I can get this going so my UPS monitor will work on boot? I'm not much of a script writer. Also, would I need a similar symbolic link to kill the script at shutdown? If so and since it's my UPS, what number (ie order) should the script get? Something like K01 or is that too soon in the shutdown process?

Thanks in advance.

Last edited by nonsense28sal; 05-29-2008 at 04:45 PM.
 
Old 05-30-2008, 09:10 AM   #2
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
I believe you've given ln too many arguments, & have fallen into the "(3rd form)" mentioned in the "SYNOPSIS" section of the man page. Try:
Code:
sudo ln -s /opt/upspilot/agent S99upsagent
instead.

I believe the "S" in "S99upsagent" will cause the necessary "start" argument to be supplied automatically.

Make sure you put links in any other needed /etc/rcN.d directories, as well as /etc/rc2.d.

It's also possible that you need Kxxupsagent links in/etc/rc0.d & /etc/rc6.d.
 
Old 05-30-2008, 09:12 AM   #3
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
Your ln command is incorrect, however let's go about it another way for now. If you want to revisit the symlink, we'll deal with that later (EDIT: See Archtoads post above!).

This should work:

Locate your startup scripts (generally in /etc/rc.d or similar) and see if you have a file named like "rc.local" or "rc.local.startup".

And into that file, put a line like:

Code:
/opt/upspilot/agent start
and that should do it. Similarly, in the file "rc.local.shutdown" put the same line, but use 'stop' rather than 'start'.

I do know there is another related command that automatically configures services to stop/start and installs the symlinks you need for your first method, but I cannot recall the command at the moment. Surely someone will pop in here with that method soon

NOTE: If you cannot locate the local startup scripts, the same commands I gave can be placed into your main startup & shutdown scripts too; the difference is that by using the LOCAL ones, you have a one-stop location where you can edit stuff that you yourself have installed, and which is not part of the actual SYSTEMs default start/stop routines.

If you have troubles or cannot figure this out, either someone will pop in with a better solution, OR I will find that command for auto-inserting the S99/K99 symlinks (it is part of the SystemV startup system). EDIT - and again, Archtoad has given the basics of the SysVinit method, though I'm still sure there is a single command that installs the S/K links.. I *think*..)

SVA

Last edited by GrapefruiTgirl; 05-30-2008 at 09:16 AM. Reason: EDIT
 
  


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
Don't start automatically at boot, just directly muusle Slackware 7 04-07-2006 08:56 AM
How do I start dhclient automatically at boot-up? moonmoth Linux - Networking 4 07-17-2005 04:15 AM
dhcp won't start automatically on boot blk96gt Slackware 5 01-24-2005 01:42 PM
How do I start a program automatically when I boot up? bad_andy Mandriva 2 11-27-2004 08:15 PM
How do I start programs automatically with boot up? Kasperisa Linux - Newbie 6 07-15-2004 03:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

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