LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 06-26-2006, 12:17 AM   #1
slash72
LQ Newbie
 
Registered: Oct 2003
Location: US
Distribution: ubuntu 6.06+ foldix 0.9
Posts: 7

Rep: Reputation: 0
autostart upsd program at bootup


I have a program that I tried to add to my sessions startup but it fails to run after reboot. I can start the program in terminal using
Code:
cd /usr/local/bulldog/ ./upsd
The file originally had root as the owner, I tried changing this to my user name, still didn't start at reboot. Perhaps I'm using the wrong command in the sessions manager. I tried
Code:
/usr/local/bulldog/upsd
/usr/local/bulldog/ ./upsd
/usr/local/bulldog/sudo upsd
/usr/local/bulldog/sudo ./upsd
Any help would be appreciated.

Last edited by slash72; 06-26-2006 at 12:27 AM.
 
Old 06-26-2006, 12:20 AM   #2
prozac
Member
 
Registered: Oct 2005
Location: Australia
Distribution: slackware 12.1
Posts: 753

Rep: Reputation: 32
/user ?

/usr/local/bulldog/upsd as root should do the job.
just put it in your rc.local file and the system will start it at system boot everytime.
 
Old 06-26-2006, 01:02 AM   #3
slash72
LQ Newbie
 
Registered: Oct 2003
Location: US
Distribution: ubuntu 6.06+ foldix 0.9
Posts: 7

Original Poster
Rep: Reputation: 0
Thank you, I fixed the spelling errors in my original post, I'm used to Windows so user is a more common term. Your advice worked, although I had to look up where the rc.local file was. Below is the commands I used, may be helpful to someone new like me.
Code:
cd /etc/init.d
sudo gedit rc.local
Here's what my rc.local file looks like.
Code:
#! /bin/sh

PATH=/sbin:/bin:/usr/sbin:/usr/bin
[ -f /etc/default/rcS ] && . /etc/default/rcS
. /lib/lsb/init-functions

do_start() {
	if [ -x /etc/rc.local ]; then
		log_begin_msg "Running local boot scripts (/etc/rc.local)"
		/etc/rc.local
		log_end_msg $?
	fi
}
/usr/local/bulldog/upsd
case "$1" in
    start)
	do_start
        ;;
    restart|reload|force-reload)
        echo "Error: argument '$1' not supported" >&2
        exit 3
        ;;
    stop)
        ;;
    *)
        echo "Usage: $0 start|stop" >&2
        exit 3
        ;;
esac
I'm surprised that this worked so easily, although I'm disappointed that the sessions manager couldn't properly work. Most of my searches using google to resolve the problem said to use the session manager, which of course wasn't working for me. I've mostly used kde as a desktop(and that was years ago) rather than gnome so I'm not sure if this is an issue with gnome or not.I have a few more issues that I'm trying to resolve but for now I'm okay with ubuntu. Thank you prozac for your quick reply.
 
Old 06-26-2006, 01:14 AM   #4
prozac
Member
 
Registered: Oct 2005
Location: Australia
Distribution: slackware 12.1
Posts: 753

Rep: Reputation: 32
Quote:
slash72
Newbie

Registered: Oct 2003
Location: US
Posts: 6
Distribution: mandrake 9.1 - knoppix
Quote:
Originally Posted by slash72
I have a few more issues that I'm trying to resolve but for now I'm okay with ubuntu.
 
Old 06-27-2006, 12:10 AM   #5
slash72
LQ Newbie
 
Registered: Oct 2003
Location: US
Distribution: ubuntu 6.06+ foldix 0.9
Posts: 7

Original Poster
Rep: Reputation: 0
Ooops, forgot to update my info. I gave up on linux for awhile until it handled hardware better, especially wireless networking. Now that I have a bunch of old pc's to mess with I'm trying it again. I also needed a way to backup my files on another pc and didn't want to pay for windows again, I'm hoping to someday utilize linux as my main system but I need to learn a lot so I fix problems as well as I can in windows. I'm impressed how far things have come in a few years for linux distros.
 
  


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
program to autostart a killed service ~=gr3p=~ Linux - Networking 4 02-21-2006 12:04 AM
Autostart program mrrrl Red Hat 1 03-27-2005 12:58 PM
How to start a program at bootup time? shilpig Linux - Software 6 09-28-2004 01:45 PM
How to set a program to autostart upon Fedora Boot j3ff Fedora 1 08-30-2004 05:32 AM
Running Java Socket Program in a shell during bootup TomCruise2002 Linux - Newbie 1 10-15-2002 10:28 PM

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

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