View previous topic :: View next topic |
Author |
Message |
blaksaga Guru
Joined: 19 May 2003 Posts: 461 Location: Omaha, NE, USA
|
Posted: Sat Nov 22, 2003 9:17 am Post subject: giftd at startup |
|
|
How would I get gift to automatically run at startup? Either that or get it to automatically load and close when giftcurs opens and closes!? Any suggestions!? |
|
Back to top |
|
|
kernja n00b
Joined: 12 Jun 2003 Posts: 65
|
Posted: Sat Nov 22, 2003 10:10 am Post subject: |
|
|
maybe try something like this to make it start with giftcurs
Code: | #!/bin/bash
giftd -d;
giftcurs;
killall giftd;
|
put that in a file like /usr/bin/gift_start
Alternatively you could put the line
in /etc/conf.d/local.start and
in /etc/conf.d/local.stop to start it at boot |
|
Back to top |
|
|
idoneus Apprentice
Joined: 26 Mar 2003 Posts: 243 Location: Graz, Austria
|
Posted: Sat Nov 22, 2003 10:14 am Post subject: |
|
|
There are various ways to accomplish this.
You could either add it to your local.start in /etc/conf.d/
Code: | # /etc/conf.d/local.start:
# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/conf.d/local.start,v 1.4 2002/11/18 19:39:22 azarah Exp $
# This is a good place to load any misc.
# programs on startup ( 1>&2 )
/usr/bin/giftd -d |
While this may be the easier way, it's not really an ideal solution.
I usually write small start stop scripts to accomplish such tasks.
Code: | #!/sbin/runscript
#
#-----------------------------------------------------
# simple script to start giftd at boot time.
#-----------------------------------------------------
#
depend() {
need net
}
start() {
ebegin "Starting giftd"
/usr/bin/giftd -d
eend $? "Failed to start giftd"
}
stop() {
ebegin "Stopping giftd"
#something else would be better than just sending the kill signal
killall giftd
eend $? "Failed to stop giftd"
} | Simply copy this code to a file, e.g. giftd, in /etc/init.d/.
Then run Code: | rc-update add giftd default | The next reboot should launch giftd automatically and inform you with an [OK] next to Starting giftd... when it succeeded.
If you don't want to reboot you just have to run Code: | /etc/init.d/giftd start |
I hope this suits your needs. |
|
Back to top |
|
|
blaksaga Guru
Joined: 19 May 2003 Posts: 461 Location: Omaha, NE, USA
|
Posted: Sat Nov 22, 2003 9:44 pm Post subject: |
|
|
Code: |
localhost init.d # rc-update add giftd default
* giftd not executable; skipping
|
|
|
Back to top |
|
|
blaksaga Guru
Joined: 19 May 2003 Posts: 461 Location: Omaha, NE, USA
|
Posted: Sat Nov 22, 2003 9:51 pm Post subject: |
|
|
Code: |
localhost root # gift_start
-bash: /usr/bin/gift_start: Permission denied
|
Why would permission be denied...even as root??? |
|
Back to top |
|
|
princeofchaos Tux's lil' helper
Joined: 11 Jun 2003 Posts: 107
|
Posted: Sat Nov 22, 2003 10:02 pm Post subject: |
|
|
chmod +x gift_start |
|
Back to top |
|
|
idoneus Apprentice
Joined: 26 Mar 2003 Posts: 243 Location: Graz, Austria
|
Posted: Sat Nov 22, 2003 10:09 pm Post subject: |
|
|
princeofchaos wrote: | chmod +x gift_start | same is true for the start stop script. sorry that I forgot to mention that one. |
|
Back to top |
|
|
blaksaga Guru
Joined: 19 May 2003 Posts: 461 Location: Omaha, NE, USA
|
Posted: Sun Nov 23, 2003 4:07 am Post subject: thanks |
|
|
Thanks all it works great. I appreciate the help! |
|
Back to top |
|
|
m@o Apprentice
Joined: 25 Nov 2003 Posts: 184 Location: /eu/at/grz
|
Posted: Sat Jan 31, 2004 4:55 pm Post subject: |
|
|
for me it didn't work at first.
the problem was that i did configurate my gift as normal user
i changed the script to the follwing and it works for me:
Code: |
#!/sbin/runscript
#
#-----------------------------------------------------
# simple script to start giftd at boot time.
#-----------------------------------------------------
#
depend() {
need net
}
start() {
ebegin "Starting giftd"
su - MYUSERID && /usr/bin/giftd -d
exit
eend $? "Failed to start giftd"
}
stop() {
ebegin "Stopping giftd"
#something else would be better than just sending the kill signal
killall giftd
eend $? "Failed to stop giftd"
} |
hth
m@o |
|
Back to top |
|
|
|