Run at boot


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Run at boot
# 1  
Old 01-28-2011
Run at boot

Hi there Smilie!

I've set up my own openSuse server and It's working perfectly, but... Some stuff has to be executed at boot, but it won't. I've tried boot.local and init.d but nothing works. This are the things that needs to be execute:
Code:
# Free the SSH port
killall xinetd

# Run subversion
svnserve -r /svn -d

# Start Trac (after Apache start)
tracd -p 30 --auth="*",/project/passwd,trac -e /project --daemonize

How can I do this?
# 2  
Old 01-28-2011
I would use the example init.d scripts that come with trac
and one similar to this one for svn server
Note in the trac one the header:
Code:
#!/bin/sh
### BEGIN INIT INFO
# Provides:          tracd
# Required-Start:    networking
# Required-Stop:     networking
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start the tracd standalone Trac web server.
### END INIT INFO
# (C) 2008 Guy Rutenberg <http://www.guyrutenberg.com>

This is very important on SuSE distro's as its used by "insserv" to decide what to start and when. If you add one of these headers to the svn serve init.d script above and save them both to /etc/init.d and tweak their settings for your installation.

Then use "chkconfig -del" to stop the xinetd service from starting (as opposed to using the "killall xinetd" entry - I assume thats what you want)

And then use "chkconfig -add" to enable the other two new scripts, and then run "insserv" it should automatically add the two scripts in at the right levels with the right dependencies.

Use "chkconfig -list" with a grep to display the new services to check they are now enabled, and reboot.

Hopefully this should sort all your startup issues in a nice SuSE way.

I hope this helps...
# 3  
Old 01-28-2011
Hi thanks!! Smilie Subversion does work now, but I can't get Trac to work at startup. I've modified the code and now I have the following:
Code:
#! /bin/sh
### BEGIN INIT INFO
# Provides:          tracd
# Required-Start:    
# Required-Stop:     
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start the tracd standalone Trac web server.
### END INIT INFO
# (C) 2008 Guy Rutenberg <http://www.guyrutenberg.com>
 
set -e
 
. /lib/lsb/init-functions
 
case "$1" in
  start)
	tracd -p 30 --auth="*",/project/passwd,trac -e /project --daemonize
	;;
  stop)
	killall tracd
	;;
  restart|force-reload)
	killall tracd
	;;
esac
 
exit 0

But, trac doesn't work. If I call /etc/init.d/trac start then it's started, but it doesn't start at boot. I did chkconfig --add trac. What can I do now?
# 4  
Old 01-28-2011
What does "chkconfig --list | grep trac" give you ?
# 5  
Old 01-28-2011
This:

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

[EDIT]Ahh smileys :P

I editted the script but it still doesn't work Smilie :
Code:
#!/bin/bash
#
#	/etc/rc.d/init.d/trac
#
# Starts the Trac Daemon
#
# description: Trac Daemon

# processname: trac
 
set -e
 
. /lib/lsb/init-functions
 
case "$1" in
  start)
	tracd -p 30 --auth="*",/project/passwd,trac -e /project --daemonize
	;;
  stop)
	killall tracd
	;;
  restart|force-reload)
	killall tracd
	;;
esac
 
exit 0

# 6  
Old 01-28-2011
Hmmm...the header on the init.d/trac says startup on runlevel 2, but the list says it isnt. Do you need to re-run "insserv" ? That should read the header and make the desired changes
# 7  
Old 01-28-2011
Now, I editted trac -> (See last post). The header is changed. But why doesn't it work at boot?
When I re-run insserv, I get this:
Code:
insserv: warning: script 'S01trac' missing LSB tags and overrides
insserv: warning: script 'S01subversion' missing LSB tags and overrides
insserv: warning: script 'trac' missing LSB tags and overrides
insserv: warning: script 'subversion' missing LSB tags and overrides

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Solaris

Change run level at boot

for solaris 11, how does one change the run level at boot from 3 to 2? i checked "/etc/inittab" file where i usually change it in other *nix but it seems solaris is not using it. (1 Reply)
Discussion started by: badbanana
1 Replies

2. UNIX for Dummies Questions & Answers

Boot vs run

Hello! Please, what ELSE do we BOOT except of operating systems? Can someone list me at least some programs which we boot and are not OSs? Many thanks¨! (1 Reply)
Discussion started by: pinklemon
1 Replies

3. UNIX for Advanced & Expert Users

has no rc.local in /etc, how to auto run cmd in the boot process?

Hi I want to run some cmd before the linux boot up and I want to let it run before sshd service start, any helps? (1 Reply)
Discussion started by: yanglei_fage
1 Replies

4. UNIX for Dummies Questions & Answers

How to run linux in windows 7 without dual boot?

tell me in steps if its virtual box (2 Replies)
Discussion started by: mahor1989
2 Replies

5. Solaris

Solaris x86 installation using jumpstart does not local boot ( boot from hdd)

I am trying to install Solaris x86 using the Jumpstart server. I run the add_install_client command with appropriate options, and reboot my x86 Target box. The installation starts fine and unattended. After the installation completes and the target goes for a re-boot, it does not boot from the HDD... (9 Replies)
Discussion started by: hemalsid
9 Replies

6. Boot Loaders

Reboot and Select Proper Boot device or insert Boot media in select Boot device and press a key

Hello, I have kubuntu on my laptop and now I decided to switch to Windows 7. I made the bios settings properly (first choice is boot from cd\vd) but I see the error " reboot and select proper Boot device or insert Boot media in select Boot device and press a key " I have tried CD and... (0 Replies)
Discussion started by: rpf
0 Replies

7. Debian

Grub2 (dual boot, dmraid) cannot run Debian6

Hello, firstly excuse for my poor english. I have a busybox error when I try to run Debian 6. It's like Grub cannot find root (initramfs) My system is: - RAID0 with dmraid - /boot ext2 (from moonOS installation --ubuntu based--) - ext4 (moonOS wich have the Grub2 installation, where I... (0 Replies)
Discussion started by: neutralTTY
0 Replies

8. Solaris

solaris boot problem boot error loading interpreter(misc/krtld)

When I installed the SOLARIS 10 OS first time, the desktop would not start up, this was because of network setup. Reinstalled worked. After a week due to some problem I had to reinstall OS, installation went fine and but when i reboot I get this error. cannot find mis/krtld boot error loading... (0 Replies)
Discussion started by: johncy_j
0 Replies

9. UNIX for Advanced & Expert Users

Cannot boot - Boot : Panic : File size out of range (EWS-UX/V unix)

Hey ! I am running EWS-UX/V (Rel 4.2) on NEC EWS/4800/330 station and I am having problems rebooting my station : I am getting the following message on display : BOOT : PANIC : File size out of range. According to user guide, this error is occuring when a file exceeding the limit and/or... (2 Replies)
Discussion started by: fredo
2 Replies
Login or Register to Ask a Question

Featured Tech Videos