Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
giftd at startup
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
blaksaga
Guru
Guru


Joined: 19 May 2003
Posts: 461
Location: Omaha, NE, USA

PostPosted: Sat Nov 22, 2003 9:17 am    Post subject: giftd at startup Reply with quote

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
View user's profile Send private message
kernja
n00b
n00b


Joined: 12 Jun 2003
Posts: 65

PostPosted: Sat Nov 22, 2003 10:10 am    Post subject: Reply with quote

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
Code:
giftd -d

in /etc/conf.d/local.start and
Code:
killall giftd

in /etc/conf.d/local.stop to start it at boot
Back to top
View user's profile Send private message
idoneus
Apprentice
Apprentice


Joined: 26 Mar 2003
Posts: 243
Location: Graz, Austria

PostPosted: Sat Nov 22, 2003 10:14 am    Post subject: Reply with quote

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
View user's profile Send private message
blaksaga
Guru
Guru


Joined: 19 May 2003
Posts: 461
Location: Omaha, NE, USA

PostPosted: Sat Nov 22, 2003 9:44 pm    Post subject: Reply with quote

Code:

localhost init.d # rc-update add giftd default
 * giftd not executable; skipping
Back to top
View user's profile Send private message
blaksaga
Guru
Guru


Joined: 19 May 2003
Posts: 461
Location: Omaha, NE, USA

PostPosted: Sat Nov 22, 2003 9:51 pm    Post subject: Reply with quote

Code:

localhost root # gift_start
-bash: /usr/bin/gift_start: Permission denied


Why would permission be denied...even as root???
Back to top
View user's profile Send private message
princeofchaos
Tux's lil' helper
Tux's lil' helper


Joined: 11 Jun 2003
Posts: 107

PostPosted: Sat Nov 22, 2003 10:02 pm    Post subject: Reply with quote

chmod +x gift_start
Back to top
View user's profile Send private message
idoneus
Apprentice
Apprentice


Joined: 26 Mar 2003
Posts: 243
Location: Graz, Austria

PostPosted: Sat Nov 22, 2003 10:09 pm    Post subject: Reply with quote

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
View user's profile Send private message
blaksaga
Guru
Guru


Joined: 19 May 2003
Posts: 461
Location: Omaha, NE, USA

PostPosted: Sun Nov 23, 2003 4:07 am    Post subject: thanks Reply with quote

Thanks all it works great. I appreciate the help!
Back to top
View user's profile Send private message
m@o
Apprentice
Apprentice


Joined: 25 Nov 2003
Posts: 184
Location: /eu/at/grz

PostPosted: Sat Jan 31, 2004 4:55 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
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