| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| Lars Senior Member
 
 
 Joined: 25 Oct 2010
 Posts: 136
 
 
 | 
			
				|  Posted: Mon Mar 12, 2012 2:08 pm    Post subject: |   |  
				| 
 |  
				| 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 |  | 
	
		| gerasimos_h Site Admin
 
 
 Joined: 09 Aug 2007
 Posts: 1757
 Location: Greece
 
 | 
			
				|  Posted: Mon Mar 12, 2012 2:43 pm    Post subject: |   |  
				| 
 |  
				| 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 |  | 
	
		| Lars Senior Member
 
 
 Joined: 25 Oct 2010
 Posts: 136
 
 
 | 
			
				|  Posted: Mon Mar 12, 2012 3:29 pm    Post subject: |   |  
				| 
 |  
				| 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
   
 My best regards
 
 Lars
 |  | 
	
		| Back to top |  | 
	
		| Lars Senior Member
 
 
 Joined: 25 Oct 2010
 Posts: 136
 
 
 | 
			
				|  Posted: Mon May 07, 2012 10:01 am    Post subject: |   |  
				| 
 |  
				| 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 |  | 
	
		| gerasimos_h Site Admin
 
 
 Joined: 09 Aug 2007
 Posts: 1757
 Location: Greece
 
 | 
			
				|  Posted: Mon May 07, 2012 2:21 pm    Post subject: |   |  
				| 
 |  
				| 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 |  | 
	
		| Lars Senior Member
 
 
 Joined: 25 Oct 2010
 Posts: 136
 
 
 | 
			
				|  Posted: Mon May 07, 2012 7:54 pm    Post subject: |   |  
				| 
 |  
				| Thank you  ! 
 That explains something I've wondered about for some weeks!
 
 Best regards
 Lars
 |  | 
	
		| Back to top |  | 
	
		|  |