LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-27-2005, 12:36 PM   #1
charafantah
Member
 
Registered: Feb 2005
Distribution: debian 3.0 woody/mandrake 10.1
Posts: 34

Rep: Reputation: 15
KDE Autorun


i have a small bash script, that i would like to be runned everytime a user start his computer, and everytime before he shuts down


i thought of placing it in rc5.d and rc0.d
i made
Code:
ln -s ../scripname.sh S80script


but for some weird reason, it didnt work, and it worked, when i placed the same under .kde/Autorun under each users directory....

what am i missing here?
also, is there anyother way to run it in shutdown else than rc0.d ? as i might use Autorun in .kde if i can find somehow to run before shutdown



regards,
Achraf El Kashef

Last edited by charafantah; 07-28-2005 at 05:12 AM.
 
Old 07-27-2005, 12:49 PM   #2
traene
Member
 
Registered: Jan 2005
Distribution: Archlinux, Debian, Centos
Posts: 222

Rep: Reputation: 35
I think your skirpt needs a start (and a stop) method. something like:

Code:
case $1 in
    start)
         # do start your things.
        ;;
    stop)
        # do whatever to stop your things
        ;;
     *)
         # print some usage.
         ;;
esac
You may have a look at the other scripts.
 
Old 07-28-2005, 05:11 AM   #3
charafantah
Member
 
Registered: Feb 2005
Distribution: debian 3.0 woody/mandrake 10.1
Posts: 34

Original Poster
Rep: Reputation: 15
thanks,,
that worked fine...


but my script turned out to be a complete failuer.... as its being executed before anyone log in, and my script depend on the command "whoami" a lot...

so i think it will be better if i use with the Autorun folder in ~/.kde/

but i need to run it again at logout or before shutdown.... where can i add such action?

thanks
 
Old 07-28-2005, 05:30 AM   #4
pfonseca
LQ Newbie
 
Registered: Mar 2004
Location: Lisbon, Portugal
Distribution: Debian
Posts: 9

Rep: Reputation: 0
If your script follows System V arquitecture it can be called/stopped in rc* dirs. Check other scripts that may already be there and follow their structure.

However, it seems to me that the correct place to invoque your script might me from /etc/.bashrc or similar (system wide init scripts, wich are executed at login)
 
Old 07-28-2005, 06:37 AM   #5
charafantah
Member
 
Registered: Feb 2005
Distribution: debian 3.0 woody/mandrake 10.1
Posts: 34

Original Poster
Rep: Reputation: 15
thanks for help...

i found out that if i create a directory called shutdown under ~/.kde/ it will execute anything in this dir.


so am now using
~/.kde/Autostart/ to execute at login
and
~/.kde/shutdown/ to execute when logout
and it's working fine now

thanks alot
 
Old 07-28-2005, 07:05 AM   #6
pfonseca
LQ Newbie
 
Registered: Mar 2004
Location: Lisbon, Portugal
Distribution: Debian
Posts: 9

Rep: Reputation: 0
Yes, assuming that you want to run/cleanup your script actions _only_ when your users use KDE.

I would go for ~/.bashrc , because it is independent of whether you use KDE, GNOME or other desktop manager. (but I cannot help you on the shutdown issue, regarding your whoami dependance)

regards
 
  


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



LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:45 PM.

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