Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
SMS Forum Index » SMS User Support

Post new topic   Reply to topic
TOR-server/router Goto page Previous  1, 2
View previous topic :: View next topic  
Author Message
Lars
Senior Member


Joined: 25 Oct 2010
Posts: 136

PostPosted: Mon Mar 12, 2012 2:08 pm    Post subject: Reply with quote

I was just going to add that, running /etc/rc.d/rc.tor status as root gives a more "normal" answer.

But any way, do you know the meaning of
elif kill -0 $PID; then

I read so much that elif is an alternate command, to apply if the condition kill -0 $PID is present. But what does that mean?
Back to top
View user's profile Send private message
gerasimos_h
Site Admin


Joined: 09 Aug 2007
Posts: 1757
Location: Greece

PostPosted: Mon Mar 12, 2012 2:43 pm    Post subject: Reply with quote

kill -0 $PID
indicates if a signal can be sent, meaning checking if process exist.
0 = exist
Here is an example.
Getting PID of Tor
Code:
root@sms:~# pidof tor
27206


Checking for process
Code:
root@sms:~# kill -0 27206
root@sms:~#

Getting the state
Code:
root@sms:~# echo $?
0


Now try an imaginary process like:
Code:
root@sms:~# kill -0 272061
-bash: kill: (272061) - No such process

And getting state
Code:
root@sms:~# echo $?
1


gerasimos_h

_________________
Superb! Mini Server Project Manager
http://sms.it-ccs.com
Back to top
View user's profile Send private message Visit poster's website
Lars
Senior Member


Joined: 25 Oct 2010
Posts: 136

PostPosted: Mon Mar 12, 2012 3:29 pm    Post subject: Reply with quote

Thank you, very much indeed!

I'd never seen "kill" being used that way before, "check if" or how I shall put it. I've used it, but only to kill processes (stop them as I earlier interpreted it)

Everyday I learn a little bit more, someday may even enough to dare install Slackware 14 all by myself Wink

My best regards

Lars
Back to top
View user's profile Send private message
Lars
Senior Member


Joined: 25 Oct 2010
Posts: 136

PostPosted: Mon May 07, 2012 10:01 am    Post subject: Reply with quote

I've now run a Tor-node for a couple of months. Considering my upload-bandwidth it works fairly well, transmitting between 0,5-2GB/24 h.

In /var/log/tor I noticed that every night, exactly at 04:40 tor reloads?
Code:
Apr 15 04:40:02.927 [notice] Received reload signal (hup). Reloading config and resetting internal state.
Apr 15 04:40:02.930 [notice] Tor 0.2.2.35 (git-b04388f9e7546a9f) opening new log file.


This is no setting I've made and I cannot se any other server software restarting simultaneously?

Do you know if this "HUP"-signal comes internally from the SMS-serversoftware, or perhaps could come from some Tor-networkcontrol?

Best regards
Lars
Back to top
View user's profile Send private message
gerasimos_h
Site Admin


Joined: 09 Aug 2007
Posts: 1757
Location: Greece

PostPosted: Mon May 07, 2012 2:21 pm    Post subject: Reply with quote

That sound like a logrotate

/etc/logrotate.d/tor

Code:
/var/log/tor/*log {
  daily
  rotate 5
  compress
  delaycompress
  missingok
  notifempty
  create 0644 tor tor
  sharedscripts
  postrotate
    /etc/rc.d/rc.tor reload > /dev/null
  endscript
}


gerasimos_h

_________________
Superb! Mini Server Project Manager
http://sms.it-ccs.com
Back to top
View user's profile Send private message Visit poster's website
Lars
Senior Member


Joined: 25 Oct 2010
Posts: 136

PostPosted: Mon May 07, 2012 7:54 pm    Post subject: Reply with quote

Thank you Very Happy !

That explains something I've wondered about for some weeks!

Best regards
Lars
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    SMS Forum Index » SMS User Support All times are GMT + 2 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
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 can attach files in this forum
You can download files in this forum

SMS - Superb! Mini Server Project © 2016
Powered by phpBB © 2001, 2002 phpBB Group
iCGstation v1.0 Template By Ray © 2003, 2004 iOptional