DB Hub Support Forum Forum Index DB Hub Support Forum  
  Linux/Unix hub software for Direct Connect      FAQ      Search      Memberlist      Download      Album      Czat      Statistics  
  · Log in Register · Profile · Log in to check your private messages · Usergroups  



Previous topic «» Next topic
Startup for Ubuntu
Author Message
almiteycow

Joined: 20 Aug 2006
Posts: 2
Posted: 2007-04-29, 13:51   Startup for Ubuntu


Here's quick instructions

Code:
#!/bin/sh
dbhub_start() {
  echo "Starting dbhub..."
 su dbhub -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


in terminal:
make a file /etc/init.d/dbhub (sudo gedit /etc/init.d/dbhub)
paste above into it... but change the fourth line to the user that dbhub runs under (su yourusername -c /usr/local/bin/dbhub)
save it, then make it executable (sudo chmod +x /etc/init.d/dbhub)
update rc.d (sudo update-rc.d dbhub defaults)
 
 
wiXed 
#[VIP]


Age: 31
Joined: 09 Apr 2006
Posts: 55
Location: Netherlands
Posted: 2007-05-07, 21:02   

sweet, when I start to studie Ubuntu I gonne check this out!
for now I stick in FBSD for a while ^^, (till me server arrives)

but question about ubuntu can I still enable the root account or do I have to do everything using sudo? cuz thats kinda sucky
 
 
Centurion 
Administrator


Hub address:
sadistic.no-ip.org:6669
Age: 34
Joined: 31 Mar 2006
Posts: 430
Location: Poland
Posted: 2007-05-07, 21:12   

I think that better way is using cron instead of rc.d, because you can run hub as a common user and you can run more that one hub if you need (on different accounts or even on the same with -w switch)
 
 
wiXed 
#[VIP]


Age: 31
Joined: 09 Apr 2006
Posts: 55
Location: Netherlands
Posted: 2007-05-07, 21:16   

Centurion wrote:
I think that better way is using cron instead of rc.d, because you can run hub as a common user and you can run more that one hub if you need (on different accounts or even on the same with -w switch)


hmm explain yourself, because I've no idea how it realy works.
FreeBSD uses RC scripts for starting services.
 
 
Centurion 
Administrator


Hub address:
sadistic.no-ip.org:6669
Age: 34
Joined: 31 Mar 2006
Posts: 430
Location: Poland
Posted: 2007-05-07, 21:18   

man crontab ;]

http://mieszkancy.ds.pg.g...topic.php?t=239
 
 
wiXed 
#[VIP]


Age: 31
Joined: 09 Apr 2006
Posts: 55
Location: Netherlands
Posted: 2007-05-07, 21:23   

yeah I know the crontab BSD got that too,
but what BSD not got is fuser...

but I never took a closer look,
if it crashes, i notise it soon enough ;P
 
 
Centurion 
Administrator


Hub address:
sadistic.no-ip.org:6669
Age: 34
Joined: 31 Mar 2006
Posts: 430
Location: Poland
Posted: 2007-05-08, 16:59   

BSD has got similar command: sockstat

http://www.gsp.com/cgi-bi...&topic=sockstat
 
 
wiXed 
#[VIP]


Age: 31
Joined: 09 Apr 2006
Posts: 55
Location: Netherlands
Posted: 2007-05-08, 23:50   

LOL damn I never knew that :$ i'll check it out right away

well sockstat didn't do the job because if there's no TCP match it simply echo there's no match...
So the string isn't empty and test -z won't work...

but, i fixed this.. and it works on FreeBSD

Code:
#!/bin/bash

RUNNING=$(netstat -an | grep tcp | grep LISTEN | grep 1114)
if test -z "$RUNNING" ; then
killall dbhub
sleep 3
/usr/local/bin/dbhub
fi


so now it works in Linux and FBSD :)
BTW ilektrojohn's post did the job too
 
 
Kiri11 

Hub address:
123-125.homeip.net
Joined: 09 May 2008
Posts: 4
Location: Minsk, BY
Posted: 2008-05-25, 19:30   

Yes, it works for Debian too.
_________________
 
 
Display posts from previous:   
Reply to topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
Add this topic to your bookmarks
Printable version

Jump to:  



Powered by phpBB modified by Przemo © 2003 phpBB Group
Template modified by Mich@≥

SourceForge.net Logo