Logo 
Search:

Unix / Linux / Ubuntu Forum

Ask Question   UnAnswered
Home » Forum » Unix / Linux / Ubuntu       RSS Feeds

ubuntu startup scripts

  Date: Dec 03    Category: Unix / Linux / Ubuntu    Views: 517
  

In windows xp there is a startup directory in which i can put any program to
automatically run after windows has booted up. Is there an equivalent set up for
Ubuntu ver 10.1?

Share: 

 

11 Answers Found

 
Answer #1    Answered On: Dec 03    

Read these:
https://help.ubuntu.com/community/RcLocalHowto
embraceubuntu.com/.../

 
Answer #2    Answered On: Dec 03    

I already tried the suggestion given in both references and they do not
work in my system. I can run my script from a terminal and it works
fine. However it will not automatically start after boot

 
Answer #3    Answered On: Dec 03    

The problem with that has to be something very basic - it isn't rocket
science after all.

File permissions, syntax errors, assumptions that hold true in a shell
session but not in a startup script (e.g. PATH and other environment
variables), any of those basic things could be hindering you.

If you could share the output of the startup script someone here could
likely spot the issue right away. Hopefully you've redirected the output
of your commands to a logfile to capture that output.

 
Answer #4    Answered On: Dec 03    

Since am fairly new to ubuntu i don't know how to set the redirection
up. I would greatly appreciate it If you could give some directions on
how to accomplish this

 
Answer #5    Answered On: Dec 03    

You could do something like this:

First copy stderr to stdout, then use tee to copy stdout to a file:

yourscript.sh 2>&1 |tee /tmp/out.log

Also remember that your startup script will run as root and that the
$PATH may not have been fully set-up at run time. Any file references
should use their full path.

 
Answer #6    Answered On: Dec 03    

Tried

grub-env.sh 2>&1 |tee /tmp/out.log and got a log output that CUPS started . No
other message was in the log file. I went looking thorough the other log files
and it appears that the grub-env.sh is called and the command executed and then
some other program shuts down the CUPS scheduler

 
Answer #7    Answered On: Dec 03    

Will it execute if you click on it in the file manager? If not then you will
have to right click, go to Properties and check the box in the Permissions
to make it executable.

 
Answer #8    Answered On: Dec 03    

When i click on the script while in nautilus, i get a screen asking if i
want to display or run the file. When i choose run, the script runs
and produces the desired results.

 
Answer #9    Answered On: Dec 03    

The run or display dialog allows you to execute the file or edit it which is
useful for scripts. I put scripts that I want to run in a folder in my home
folder. I use bin but it does not have to be that one. Then I go to System,
Preferences, Startup Applications and choose Add. I give it a name and type
in the command. You need to use the full line. However if it is a script you
need to use sh space (or./nospace) before the command. Perhaps you
are omitting this step.

 
Answer #10    Answered On: Dec 03    

works great when use ./grub-env.sh in a terminal. AS soon as i can i
will try clicking on the script while in nautilus

 
Answer #11    Answered On: Dec 03    

there is no Ubuntu 10.1. There is 9.10 and 10.04. The number before
the decimal is the year it was released and the number after is the
month.There will be an Ubuntu 10.10 (for October of this year but not
written as 10.1 because it could be confused with January), but they have
not even begun it yet. I point this out not to nitpick but to inform you
that the numbers are significant. BTW, people not write 10.04 as 10.4
because 10.04 comes out in April and 10.4 would come out in the 40th month
if there was one. Think money.

As to your question there is no such folder. The reason has to do with
permissions. Windows is lax and Linux is strict about these things. The best
thing that you can do is to create a script that would run a series of
programmes and have it run as an executable or have the application added to
your Startup Applications (System, Preferences). If it an application in the
menu then you do can do this just by adding it to Startup Applications.
However if it is a binary or script then you need to change the permissions
to make it executable first.

When I say Windows is lax I mean that anybody can do this without your
permission and they frequently do. This causes many security and performance
issues in Windows. In Linux these things need you to go the extra mile and
nobody can do it without your knowledge. This is for your benefit and
protection.

 
Didn't find what you were looking for? Find more on ubuntu startup scripts Or get search suggestion and latest updates.




Tagged: