Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Other Things Gentoo
  • Search

init.d scripts

Still need help with Gentoo, and your question doesn't fit in the above forums? Here is your last bastion of hope.
Post Reply
Advanced search
14 posts • Page 1 of 1
Author
Message
snacknuts
n00b
n00b
Posts: 7
Joined: Tue Aug 15, 2006 5:55 pm

init.d scripts

  • Quote

Post by snacknuts » Tue Aug 15, 2006 6:01 pm

Today I noticed that all /etc/init.d/ scripts that "--exec" shell scripts have started failing.

for example:

/etc/init.d/courier-imap start
* Starting courier-imapd ... [ !! ]

/etc/init.d/jabberd and courier-imap-ssl also fail.

syslog indicates that the shell scripts being exec'd start and are then immediatly stopped (killed?)

please help :)
Top
jk3us
Apprentice
Apprentice
Posts: 201
Joined: Mon Mar 14, 2005 6:12 am
Location: Memphis, TN
Contact:
Contact jk3us
Website

  • Quote

Post by jk3us » Tue Aug 15, 2006 9:45 pm

baselayout has been updated several times lately, did you do an etc-update after your last emerge world?
Top
snacknuts
n00b
n00b
Posts: 7
Joined: Tue Aug 15, 2006 5:55 pm

[solved] (kind of)

  • Quote

Post by snacknuts » Wed Aug 16, 2006 3:10 pm

Figured out the problem. runscript doesn't like running shell scripts via start-stop-daemon. my solution was to rewrite the startup scripts and not use start-stop-daemon :P
Top
timotheus25
Apprentice
Apprentice
Posts: 162
Joined: Tue Dec 27, 2005 3:02 am
Location: *upstate* New York, USA
Contact:
Contact timotheus25
Website

Re: init.d scripts

  • Quote

Post by timotheus25 » Wed Aug 16, 2006 5:35 pm

snacknuts wrote:Today I noticed that all /etc/init.d/ scripts that "--exec" shell scripts have started failing.
This is one royal pain. Is it the intended behavior on the part of the devs that only start-stop-daemon runs binaries? What about chuid for scripts? What is the best approach to compensate? Was this caveat discussed in Gentoo Weekly Newsletter or something comparable?

See Bug 143951 , it helps for the slight case of having the shell script change its process name.
http://tstotts.net/linux/gentoopb.html
http://tstotts.net/linux/gentooinsp640m.html
Top
UberLord
Retired Dev
Retired Dev
User avatar
Posts: 6838
Joined: Thu Sep 18, 2003 10:26 am
Location: Blighty
Contact:
Contact UberLord
Website

Re: init.d scripts

  • Quote

Post by UberLord » Wed Aug 16, 2006 6:37 pm

timotheus25 wrote:This is one royal pain. Is it the intended behavior on the part of the devs that only start-stop-daemon runs binaries?
Technically you can run scripts - provided that the script is the daemon and uses #!/bin/bash instead of #!env bash
The problem is that what s-s-d executes is expected to be the daemon. In courier-imaps case what is executes is really a script that launches daemons. I submitted fixed scripts for that over a year ago, but for various reasons (devs retired is one) i never got stabled. That is now happening

Same for jabber I think as it was #!env python instead of #!/usr/bin/python
What about chuid for scripts? What is the best approach to compensate?
Again, you can use chuid for scripts provided they meet the above criteria - or move the logic of the "script" into the init script and solve the issue that way.
Was this caveat discussed in Gentoo Weekly Newsletter or something comparable?
Actually yes. I sent out 3 e-mails to the gentoo-dev mailing list, and no-one objected. I also emailed how to solve existing init scripts. I informed people though the correct channels.
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Top
timotheus25
Apprentice
Apprentice
Posts: 162
Joined: Tue Dec 27, 2005 3:02 am
Location: *upstate* New York, USA
Contact:
Contact timotheus25
Website

Re: init.d scripts

  • Quote

Post by timotheus25 » Wed Aug 16, 2006 7:00 pm

UberLord wrote: Technically you can run scripts - provided that the script is the daemon and uses #!/bin/bash instead of #!env bash
The problem is that what s-s-d executes is expected to be the daemon.
Thanks, but I am still looking for a solution.
Jabber is a good example of a now broken service. I have jabberd-2.0.11 installed (latest).

Code: Select all

% head -n 7 /usr/bin/jabberd 
#!/bin/sh
#-*-Perl-*-

exec perl -w -x $0 "$@"

#!perl

Code: Select all

% grep -A 2 -- --start /etc/init.d/jabber
        start-stop-daemon --start -c jabber:jabber \
                --make-pidfile --pidfile /var/run/jabber/jabberd.pid \
                --background -q -x /usr/bin/jabberd
Unfortunately, this does not work. Jabberd runs perfectly for one second, but then s-s-d kills it and fails the service.
Also, I want to run many python scripts that create PID files but do not rename their process as a daemon. What can I do?

For example:

Code: Select all

% cat /usr/local/jabber/bin/pyaim-t.sh
#!/bin/bash
CMD=/usr/lib/python2.4/site-packages/pyaim-t/pyaim-t.py
exec python $CMD -c /etc/jabber/pyaim-t.xml -l /var/log/jabber/pyaim-t.log

Code: Select all

% grep -A 3 -- --start /etc/init.d/pyaim-t
        start-stop-daemon --name pyaim-t.sh --start --background --chuid jabber:jabber \
                --exec /usr/local/jabber/bin/pyaim-t.sh
        true
        eend $?
And the change of the $? is necessary for it to pass the 'start' function.
Since all of these create PID files, stopping with s-s-d is obvious.

Would bugging baselayout for a a s-s-d man-page example w.r.t. scripts be reasonable?
http://tstotts.net/linux/gentoopb.html
http://tstotts.net/linux/gentooinsp640m.html
Top
UberLord
Retired Dev
Retired Dev
User avatar
Posts: 6838
Joined: Thu Sep 18, 2003 10:26 am
Location: Blighty
Contact:
Contact UberLord
Website

Re: init.d scripts

  • Quote

Post by UberLord » Wed Aug 16, 2006 7:39 pm

timotheus25 wrote:
UberLord wrote: Technically you can run scripts - provided that the script is the daemon and uses #!/bin/bash instead of #!env bash
The problem is that what s-s-d executes is expected to be the daemon.
Thanks, but I am still looking for a solution.
Jabber is a good example of a now broken service. I have jabberd-2.0.11 installed (latest).
jabber is a bad case for start-stop-daemon. The last time I looked at the script which is the "daemon" it really launched 4 separate daemons.
http://bugs.gentoo.org/show_bug.cgi?id=102546
Also, I want to run many python scripts that create PID files but do not rename their process as a daemon. What can I do?

For example:

Code: Select all

% cat /usr/local/jabber/bin/pyaim-t.sh
#!/bin/bash
CMD=/usr/lib/python2.4/site-packages/pyaim-t/pyaim-t.py
exec python $CMD -c /etc/jabber/pyaim-t.xml -l /var/log/jabber/pyaim-t.log

Code: Select all

% grep -A 3 -- --start /etc/init.d/pyaim-t
        start-stop-daemon --name pyaim-t.sh --start --background --chuid jabber:jabber \
                --exec /usr/local/jabber/bin/pyaim-t.sh
        true
        eend $?
It's called start-stop-daemon for a reason - and what you are trying to run is NOT a daemon.
This may work

Code: Select all

start-stop-daemon --start --exec python -- background --chuid jabber:jabber \
   -- /usr/lib/python2.4/site-packages/pyaim-t/pyaim-t.py \
   -c /etc/jabber/pyaim-t.xml -l /var/log/jabber/pyaim-t.log
Would bugging baselayout for a a s-s-d man-page example w.r.t. scripts be reasonable?
Sure - make a patch for our man page and we'll include it :)
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Top
halfgaar
l33t
l33t
User avatar
Posts: 781
Joined: Sun Feb 22, 2004 1:50 pm
Location: Netherlands
Contact:
Contact halfgaar
Website

  • Quote

Post by halfgaar » Thu Aug 17, 2006 6:35 pm

I submitted fixed scripts for that over a year ago, but for various reasons (devs retired is one) i never got stabled. That is now happening
Does that mean the next update of courier-imap has this fixed? I mean, I can hack startup scripts myself, but on the next update I overwrite this init.d script, so if there is no official solution, I have to remember not to overwrite the script on etc-update. That I remember is unlikely to happen, because one shouldn't make custom modification to init.d scripts, and therefore I always overwrite them with etc-update.
Top
UberLord
Retired Dev
Retired Dev
User avatar
Posts: 6838
Joined: Thu Sep 18, 2003 10:26 am
Location: Blighty
Contact:
Contact UberLord
Website

  • Quote

Post by UberLord » Thu Aug 17, 2006 7:40 pm

halfgaar wrote:
I submitted fixed scripts for that over a year ago, but for various reasons (devs retired is one) i never got stabled. That is now happening
Does that mean the next update of courier-imap has this fixed?
I believe that version 4.0.4 in portage right now has fixed scripts.
http://bugs.gentoo.org/show_bug.cgi?id=143830
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Top
optics
n00b
n00b
Posts: 17
Joined: Sat Jul 15, 2006 4:53 pm

  • Quote

Post by optics » Fri Aug 18, 2006 4:07 am

vmware startup is suffering from a similar problem after baselayout update. On boot it seems to fly past vmware start (maybe a parallel start?)

When in terminal I notice none of the vmware eth adapters are up. I try to manually start the vmware init.d script and it simply hangs. Is a reinstall of vmware necessary after such a baselayout change?

I'm also not sure what is the best way to look for errors. The usual messages that appeared on individual components of larger init.d starts are not there (ok's or !!'s). I also ran metalog and don't see any activity in /var/log/everything.
Top
optics
n00b
n00b
Posts: 17
Joined: Sat Jul 15, 2006 4:53 pm

  • Quote

Post by optics » Fri Aug 18, 2006 11:14 am

interesting.. a reemerge fixed vmware.

still have some funkiness with this new baselayout.. shutdown doesn't complete hangs on various services..
Top
zaphyr
Guru
Guru
User avatar
Posts: 312
Joined: Tue Dec 07, 2004 11:28 am
Location: Copenhagen, Denmark

  • Quote

Post by zaphyr » Sat Aug 19, 2006 10:47 am

same here
shutdown stops after hostname, have to use ctrl+c to kill it and then it says it can not stop net.lo and some other stuff.
after boot, I have noticed that samba and cupsd is not running, maybe others as well.
example:

Code: Select all

# /etc/init.d/cupsd status
 * status:  starting
no fix for this?
emerge IQ
Top
zaphyr
Guru
Guru
User avatar
Posts: 312
Joined: Tue Dec 07, 2004 11:28 am
Location: Copenhagen, Denmark

  • Quote

Post by zaphyr » Thu Aug 31, 2006 5:03 am

disabling parallel startup fixed my problems
emerge IQ
Top
lyallp
Veteran
Veteran
User avatar
Posts: 1655
Joined: Thu Jul 15, 2004 12:07 am
Location: Adelaide/Australia
Contact:
Contact lyallp
Website

  • Quote

Post by lyallp » Thu Aug 31, 2006 8:17 am

I had slightly different problems with my startup scripts which you can look at http://forums.gentoo.org/viewtopic-t-49 ... ight-.html

I had a custom written daemon script (popfile to be precise) which was based upon other scripts.

Maybe my resolution might help others (see last entry of the post).
...Lyall
Top
Post Reply

14 posts • Page 1 of 1

Return to “Other Things Gentoo”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic