Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 21 Aug 2014, 20:02
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Where do I edit for a program to start automatically?SOLVED
Post new topic   Reply to topic View previous topic :: View next topic
Page 2 of 2 [20 Posts]   Goto page: Previous 1, 2
Author Message
RSH


Joined: 05 Sep 2011
Posts: 2391
Location: Germany

PostPosted: Sat 31 Aug 2013, 17:21    Post subject:  

Hi.

You can put a script for that in /root/Startup.

Since the welcome1stboot is a compiled binary you can check if it is still running by 'pidof'

I'm currently running Firefox, so pidof firefox gives me 32146 as the process ID

I'm not running aqualung, so pidof aqualung give me nothing, which means, an empty string --> "" <-- returns.

You could use a loop to sleep 1 second after checking for pidof welcome1stboot is NOT "" and executing the functions of your script after pidof welcome1stboot is "".

Code:
BNameOfProg="welcome1stboot"
DontRun="true"
while [ "$DontRun" = "true" ];
do
   if [ "`pidof "'$BNameOfProg'"`" != "" ]; then
      echo "'$BNameOfProg' is still running"
      sleep 1
      else
      echo "'$BNameOfProg' has been exited"
      DontRun="false"
   fi
done

Your script functions here

This should help.

_________________
LazY Puppy
RSH's DNA
SARA B.
Back to top
View user's profile Send private message 
oldyeller


Joined: 15 Nov 2011
Posts: 779
Location: Mishawaka IN

PostPosted: Sat 31 Aug 2013, 17:35    Post subject:  

seaside wrote:
oldyeller,

Another approach would be to put welcome1stboot into a "wrapper" script like this -

rename /usr/sbin/welcome1stboot /usr/sbin/welcome1stboot-bin

Make script called /usr/sbin/welcome1stboot -
Code:
#!/bin/sh
/usr/sbin/welcome1stboot-bin
#your script  here
exit


When welcome1stboot is called, the above script will run and when the dialog is closed "your script here" will run.

Cheers,
s


For something so simple it worked just fine.

I did however do some testing before I saw this post. I edited the delayedrun by replacing the welcome1stboot with my own and that worked as well.
Back to top
View user's profile Send private message 
oldyeller


Joined: 15 Nov 2011
Posts: 779
Location: Mishawaka IN

PostPosted: Sat 31 Aug 2013, 17:52    Post subject:  

Hi RSH,

I did try your as well, but it would start my script even after restarting x-server which is something I don't want to happen. Maybe it is the code

Code:

#!/bin/sh
BNameOfProg="welcome1stboot"
DontRun="true"
while [ "$DontRun" = "true" ];
do
   if [ "`pidof "'$BNameOfProg'"`" != "" ]; then
      echo "'$BNameOfProg' is still running"
      sleep 1
      else
      echo "'$BNameOfProg' has been exited"
      DontRun="false"
   fi
done

/usr/sbin/welcome

exit


This could be the problem.
Back to top
View user's profile Send private message 
oldyeller


Joined: 15 Nov 2011
Posts: 779
Location: Mishawaka IN

PostPosted: Sun 01 Sep 2013, 03:56    Post subject:  

Hello Everyone,

I just wanted to say Thanks very much for your help Very Happy Very Happy Very Happy

I got it to work!!!! Thanks again

Cheers
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4335

PostPosted: Sun 01 Sep 2013, 22:58    Post subject:  

FYI, Puppy does this in a non-standard way and not in accordance with:
http://standards.freedesktop.org/autostart-spec/autostart-spec-latest.html

Since puppy is single user (root), these should all be in:
/etc/xdg/autostart/

and for a multiuser system they should be in:
$HOME/.config/autostart/

For better portability in future Pups I would recommend using these (maybe submit a woof patch to Barry) and making $HOME/Startup a symlink to $HOME/.config/autostart.

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 2 of 2 [20 Posts]   Goto page: Previous 1, 2
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0517s ][ Queries: 12 (0.0042s) ][ GZIP on ]