• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

automatically starting apps on system boot

zimu

Diamond Member
hey guys,

i just can't get this app to start up automatically.

i've put a script with execute permissions into my /etc/init.d/ folder, and ln'ed it to my rc.d/rc5 directory as S50<myscript>.

no go. and i don't even know where to look in the server logs to see what the issue is?

any help?
 
Apache? When I installed it, it started up automatically. At least on Ubuntu. What are you trying to run and what distro are you using?
 
centos enterprise 5.2.
basically have this daemon i want to run which is run by, for e.g. executing "/home/user1/daemon/daemon start". so what i did was make a executable file that just calls it, e.g. "startit"
so if i type ./startit it works perfect.

then just copied the startit script into the init.d folder, made a symlink into the rc.d. but doesn't run...
 
Try adding it to chkconfig, /sbin/schkconfig --add <name>. You will need to ensure that the script in the init.d directory has these commented lines (preferably near the top for ease of checking..):

# Basic support for IRIX style chkconfig
# chkconfig: 3 91 07
# description: Manages the services needed to run VMware MUI

As you can see, that is from the httpd.vmware script on one of my CentOS 5.2 machines. It is set to start on runlevel 3 only, with start priority 91, and kill priority 07. Add those lines, with changes as necessary, to the init.d script, and then add to chkconfig. Then you can do:

/sbin/chkconfig <name> on
 
is this the apache package that is delivered with cent or is this your own unique build? if it's from cent, there should be a service for it, chkconfig to see what run levels it's set to. Sometimes it's called httpd or http-server

If it's not there, i'd recommend that you make it a service, but lets start by seeing why httpd isn't starting.

first, do you source the correct environment before or within your apache startup script?
 
Oops, missed that its apache. Yeah, the standard CentOS apache will show up as httpd definitely under chkconfig --list, so try a chkconfig httpd on.
 
ok i'm really confused now, how do i do this whole chkconfig thing? and yes - sorry about my thread title, i pointed out its a webserver cause i wanted to say that i don't have some GUI or something where i can just put it into some startup-type-equivalent folder that runs automatically...

crontab: nope. startit literally just has the command to run, a single line. works if i run it from bash, not sure how to set the environment if its being run automatically...
 
chkconfig will make your scripts into a service, but they have to prepped for that. first focus on getting the script to run at boot.

what user do you run startit as? Use their profile. Add something like this into your startit

. /home/username/.bash_profile
 
Are you booting into runlevel 5? If you don't have the GUI stuff installed I believe runlevel 3 is the default in RH.
 
hmm i'll be damned it was runlevel 3.

i put the symlink into rc3.d but still no go on reboot...
 
not at the very top

do something like this

#!/bin/bash
set -x
exec > /tmp/output.out 2>&1
date
/home/user1/daemon/daemon start
date

lets see if anything shows up in /tmp/output.out
 
Back
Top