Jump to content
Калькуляторы

Помогите с init.d

Помогите пожалуйста

есть сервер Ubuntu 8.04 Server на него установлен dc++ сервер dbhub и dc++ консольный клиент microdc2, работает всё замечательно единственная проблема не могу поставить их в "автозагрузку", файл /etc/init.d/dbhub создал права на выполнение дал, уровни загрузки прописал, но не загружается понимаю что дело скорее всего в файле dbhub, помогите правильно его написать вот его содержимое сейчас:

Код:

 

#!/bin/sh

dbhub_start() {

echo "Starting dbhub..."

/usr/local/bin/dbhub

}

 

dbhub_stop() {

echo "Stopping dbhub..."

killall dbhub

}

 

dbhub_restart() {

dbhub_stop

sleep 1

dbhub_start

}

 

case "$1" in

'start')

dbhub_start

;;

'stop')

dbhub_stop

;;

'restart')

dbhub_restart

;;

*)

dbhub_start

esac

Share this post


Link to post
Share on other sites

 

#!/bin/sh

# Start/stop the dbhub daemon.

#

### BEGIN INIT INFO

# Provides: dbhub

# Required-Start: $syslog $time

# Required-Stop: $syslog $time

# Default-Start: 2 3 4 5

# Default-Stop: 0 1 6

# Short-Description: Regular background program processing daemon

# Description: tratatata

#

### END INIT INFO

 

dbhub_start() {

echo "Starting dbhub..."

su root -c /usr/local/bin/dbhub

}

 

dbhub_stop() {

echo "Stopping dbhub..."

killall dbhub

}

 

dbhub_restart() {

dbhub_stop

sleep 1

dbhub_start

}

 

case "$1" in

'start')

dbhub_start

;;

'stop')

dbhub_stop

;;

'restart')

dbhub_restart

;;

*)

dbhub_start

esac

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.