Hi Starry and Jason!
Thanks for the tip, Jason.
Starry, under /opt/wildfire/bin/extra there are two scripts; redhat-postinstall.sh and wildfired, and you need to run the redhat-script to get what you want. I haven’'t tried it, but it looks OK.
I would like the scripts to LSB compliant and according to the manual from Novell on how to add a new service under /etc/init.d. This is described in the SuSE Linux Reference, pages 418 to 421. Doing it this way, I believe SuSE users will be more at home.
I’'ve created a copy of redhat-postinstall.sh which I called suse-postinstall.sh. I then changed the lines about
- Install the init script
cp $WILDFIRE_HOME/bin/extra/wildfired /etc/init.d
/sbin/chkconfig --add wildfired
/sbin/chkconfig wildfired on
to this
- Install the init script
cp $WILDFIRE_HOME/bin/extra/wildfire-im /etc/init.d
insserv /etc/init.d/wildfire-im
The effect of running the script is to create a user and a group called jive, move the script wildfire-im to /etc/init.d/, then run insserv to add symlinks in the correct runlevels defined inside wildfire-im.
-
BEGIN INIT INFO
-
Provides: wildfire
-
Required-Start: $remote_fs $syslog
-
Required-Stop: $remote_fs $syslog
-
Default-Start: 3 5
-
Default-Stop: 0 1 2 6
-
Description: Start wildfire to provide a server for instant messaging and presence notification using XMPP, see http://www.jivesoftware.org/.
-
END INIT INFO
The rest of the script uses startproc to do the same as wildfired, but I’‘ve run into a small, but annoying problem, which I haven’'t been able to figure out yet - any help would be appreciated. Here is the problem:
When running /etc/init.d/wildfire-im start, it tries to run .install4j from the home directory of user jive. This does not work, as .install4j is in the /opt/wildfire directory. When checking the original wildfired script it changes directory to /opt/wildfire and then executes wildfire start/wildfire stop before returning to the calling directory where the command was issued. Is it required? strace output shows chdir() being called if you run /opt/wildfire/bin/wildfire start directly. Why? Any ideas?
Cheers,
Haakon