Linux help - runnin...
 

MegaSack DRAW - 6pm Christmas Eve - LIVE on our YouTube Channel

[Closed] Linux help - running a service at startup

7 Posts
4 Users
0 Reactions
139 Views
Posts: 0
Free Member
Topic starter
 

I'm trying to get a service to run at startup on SUSE 11.4 and it's having none of it.

I've added the line "/sbin/service nameserv start" to the boot.local file in init.d but nothing happens. I can use the same command as root in a terminal window once I'm logged on, so I'm obviously doing something wrong. I thought that at startup, stuff in boot.local was run as root?


 
Posted : 05/01/2012 2:28 pm
Posts: 8
Free Member
 

Have a butchers at this:

[url= http://www.novell.com/coolsolutions/feature/15380.html ]SUSE init scripts[/url]

EDIT and check 'chkconfig --list | grep servicename' to see if it is there but just turned off.


 
Posted : 05/01/2012 2:31 pm
Posts: 8177
Free Member
 

chkconfig nameserv

If you see off as the result, then

chkconfig nameserv on

To make it start in the default runlevels. Make sure it's executable.

If all else fails you could stick in it in inittab, but that's probably frowned upon 🙂


 
Posted : 05/01/2012 2:41 pm
Posts: 0
Free Member
Topic starter
 

Thanks for your help.

If I use chkconfig --list | grep nameserv I get:

nameserv 0:off 1:off 2:off 3:on 4:off 5:on 6:off

However, the application that relies on nameserv fails to work. It only works if I then enter /sbin/service nameserv start in a terminal.

I'm now really confused 😕


 
Posted : 05/01/2012 4:37 pm
Posts: 0
Free Member
 

What runlevel is the server running at ?. If it's at 2 or 4 then the service won't get started. "chkconfig --level 2345 nameserv on" will enable it for 2-5.

Edit: using "chkconfig nameserv on" will just enable it for whatever the default levels are defined in the init script.


 
Posted : 05/01/2012 4:42 pm
Posts: 0
Free Member
Topic starter
 

The server is running at 5, so it should be ok.


 
Posted : 05/01/2012 4:52 pm
Posts: 0
Free Member
 

Do you see anything in the boot logfile ?. I'm not sure what it is on SuSE. On RHEL/Fedora it's /var/log/boot.log.

If you run "init 4" then "init 5" i'd expect you to see some messages about stopping & starting your nameserv service (or at least attempting to start).


 
Posted : 05/01/2012 5:15 pm
Posts: 0
Free Member
Topic starter
 

I've found this in the boot.msg in /var/logs

service nameserv done
Starting Corba Nameserver:
<notice -- Jan 6 11:17:47.581778000> startproc: execve (/usr/bin/vmtoolsd) [ /usr/bin/vmtoolsd ], [ CONSOLE=/dev/console ROOTFS_FSTYPE=ext4 SHELL=/bin/sh TERM=linux
ROOTFS_FSCK=0 LC_ALL=POSIX INIT_VERSION=sysvinit-2.88 REDIRECT=/dev/tty7 COLUMNS=240 PATH=/bin:/sbin:/usr/bin:/usr/sbin vga=0x34d RUNLEVEL=5 PWD=/
SPLASHCFG= PREVLEVEL=4 LINES=67 HOME=/
SHLVL=2 splash=silent SPLASH=no ROOTFS_BLKDEV=/dev/disk/by-id/ata-ST3250312AS_9VYD6Z3R-part2
_=/sbin/startproc DAEMON=/usr/bin/vmtoolsd ]
<notice -- Jan 6 11:17:47.591888000>
checkproc: /usr/sbin/NetworkManager
2676

which makes absolutely no sense to me! 🙂


 
Posted : 06/01/2012 11:24 am