FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 03-08-2011, 09:26 AM
Dotan Cohen
 
Default Scripts won't run at boot

I have a short script that I use to run other scripts:
#!/bin/bash
/path/to/executable
/path/to/anotherExecutable

I need this script to run at boot. So I placed it in /etc/init.d and
made it executable. However, it doesn't run! This on an Ubuntu 10.04
machine. I tested on my own Kubuntu 10.10 machine, and it too doesn't
run! Googling around I've read about how to turn it into a service and
run it but that is a workaround: How does one have scripts run in
modern Ubuntu? The fine manual [1] suggests that being in /etc/init.d
(and being obviously executable) would be enough.

Note that I also tried running this command that I found on some blog
in the hopes that it would help, but it expects the script to be
written as a service:
update-rc.d myScriptName defaults

Thanks in advance for any information.

[1] https://help.ubuntu.com/community/UbuntuBootupHowto

--
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 03-08-2011, 09:44 AM
David Fletcher
 
Default Scripts won't run at boot

On Tue, 2011-03-08 at 12:26 +0200, Dotan Cohen wrote:
> I have a short script that I use to run other scripts:
> #!/bin/bash
> /path/to/executable
> /path/to/anotherExecutable
>
> I need this script to run at boot. So I placed it in /etc/init.d and
> made it executable. However, it doesn't run! This on an Ubuntu 10.04
> machine. I tested on my own Kubuntu 10.10 machine, and it too doesn't
> run! Googling around I've read about how to turn it into a service and
> run it but that is a workaround: How does one have scripts run in
> modern Ubuntu? The fine manual [1] suggests that being in /etc/init.d
> (and being obviously executable) would be enough.

Use /etc/rc.local? I use it to start noip2 when my server boots.

Dave



--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 03-08-2011, 12:38 PM
Tom H
 
Default Scripts won't run at boot

On Tue, Mar 8, 2011 at 5:26 AM, Dotan Cohen <dotancohen@gmail.com> wrote:
>
> I have a short script that I use to run other scripts:
> #!/bin/bash
> /path/to/executable
> /path/to/anotherExecutable
>
> I need this script to run at boot. So I placed it in /etc/init.d and
> made it executable. However, it doesn't run! This on an Ubuntu 10.04
> machine. I tested on my own Kubuntu 10.10 machine, and it too doesn't
> run! Googling around I've read about how to turn it into a service and
> run it but that is a workaround: How does one have scripts run in
> modern Ubuntu? The fine manual [1] suggests that being in /etc/init.d
> (and being obviously executable) would be enough.
>
> Note that I also tried running this command that I found on some blog
> in the hopes that it would help, but it expects the script to be
> written as a service:
> update-rc.d myScriptName defaults
>
> [1] https://help.ubuntu.com/community/UbuntuBootupHowto

Whether on Ubuntu or any other /etc/init.d/yourscript"nix system, you
have to have start (and perhaps stop) symlinks to your script in
"/etc/rc*.d/". You can do that manually or, on Ubuntu, with
update-rc.d (you can probably use chkconfig if it's installed but I've
only used it on RH boxes).

Dropping an executable into "/etc/init.d/" and expecting it run at
boot isn't a question of "modern Ubuntu" and writing a proper init
script isn't a "workaround!" I can't find anything on the link that
you've posted that suggest that this is the case. Unfortunately, that
page doesn't explain that the "script" is supposed to be of a certain
format.

The simplest way to write a correctly-formatted init.d script would be
"cp /etc/init.d/rc.local /etc/init.d/yourscript" and edit you
"/etc/init.d/yourscript" to run the executables that you want to
launch.

You can also write an upstart script "/etc/init/yoursrcipt.conf". I
can't think of a simple .conf file that you could copy and edit
off-hand.

If you only need these executables to run at boot, it's simpler to add
your lines above to "/etc/rc.local".

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 

Thread Tools




All times are GMT. The time now is 03:32 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org