LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Belkin serial UPS's agent does not start automatically at boot (https://www.linuxquestions.org/questions/linux-hardware-18/belkin-serial-upss-agent-does-not-start-automatically-at-boot-645684/)

nonsense28sal 05-29-2008 04:32 PM

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.

archtoad6 05-30-2008 09:10 AM

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.

GrapefruiTgirl 05-30-2008 09:12 AM

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


All times are GMT -5. The time now is 06:53 PM.