WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Starting processes&daemons automatically  (Read 2589 times)

Offline emninger

  • Sr. Member
  • ****
  • Posts: 267
Starting processes&daemons automatically
« on: October 31, 2015, 09:35:22 AM »
Related to how start processes automatically, looked into the FAQ and what i found there, for what i understand, that there should be scripts in
Code: [Select]
/usr/local/tce.installed.

Especially, i want conky and tor to be started on boot. Now, there is a script (for both one). But seem to me not starter but rather installer. Should i edit those scripts adding simply a line in the end like
Code: [Select]
conky -c $HOME/.conkyrc? (Is the '-c' needed? Starting from RunProgram in the wbar, conky is sufficient, it reads the .conkyrc in the home directory and not the conky.conf which came by default).

As for tor: Will tor look automatically to the $HOME/.tor/torrc?

Thanks al lot for your patience!

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: Starting processes&daemons automatically
« Reply #1 on: October 31, 2015, 09:48:29 AM »
For Conky,  -c $HOME/.conkyrc  is not needed.
I start Conky from  ~/.X.d/60-conky 
Code: [Select]
conky -p 2 -d -b -o >/dev/null 2>&1 &
The file doesn't need a line break nor does it need to be executable as it's sourced from  ~/.xsession .
Download a copy and keep it handy: Core book ;)

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: Starting processes&daemons automatically
« Reply #2 on: October 31, 2015, 09:52:17 AM »
For things that don't need X, you can use  /opt/bootlocal.sh
Code: [Select]
sleep 1 && [ -e /usr/local/sbin/basic-firewall ] && /usr/local/sbin/basic-firewall noprompt >/dev/null 2>&1 &
Download a copy and keep it handy: Core book ;)

Offline emninger

  • Sr. Member
  • ****
  • Posts: 267
Re: Starting processes&daemons automatically
« Reply #3 on: October 31, 2015, 10:43:12 AM »
For Conky,  -c $HOME/.conkyrc  is not needed.
I start Conky from  ~/.X.d/60-conky 
Code: [Select]
conky -p 2 -d -b -o >/dev/null 2>&1 &
The file doesn't need a line break nor does it need to be executable as it's sourced from  ~/.xsession .

The '-o' is needed even if there is a window definition in the conkyrc? I start conky simply by conky  -d ...

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: Starting processes&daemons automatically
« Reply #4 on: October 31, 2015, 10:50:10 AM »
No, sorry. Actually none of those are needed. I have own_window in my config, too.
-p can help sometimes though.
Download a copy and keep it handy: Core book ;)

Offline emninger

  • Sr. Member
  • ****
  • Posts: 267
Re: Starting processes&daemons automatically
« Reply #5 on: October 31, 2015, 06:44:52 PM »
Comes up to my mind: Since i use fluxbox, not flwm, could i set this processes in the fluxbox startup file as well?


Offline emninger

  • Sr. Member
  • ****
  • Posts: 267
Re: Starting processes&daemons automatically
« Reply #6 on: October 31, 2015, 06:47:47 PM »
For things that don't need X, you can use  /opt/bootlocal.sh
Code: [Select]
sleep 1 && [ -e /usr/local/sbin/basic-firewall ] && /usr/local/sbin/basic-firewall noprompt >/dev/null 2>&1 &

Just out of curiousity and to learn something linuxwise: For what it's good the ">/dev/null 2>&1" part?

Offline Greg Erskine

  • Sr. Member
  • ****
  • Posts: 404
Re: Starting processes&daemons automatically
« Reply #7 on: October 31, 2015, 06:52:34 PM »
Just out of curiousity and to learn something linuxwise: For what it's good the ">/dev/null 2>&1" part?

A quick search gave me 914,000 results  :D

Offline emninger

  • Sr. Member
  • ****
  • Posts: 267
Re: Starting processes&daemons automatically
« Reply #8 on: October 31, 2015, 10:14:17 PM »
Got it  ;)

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: Starting processes&daemons automatically
« Reply #9 on: November 01, 2015, 02:07:25 AM »
Quote
Comes up to my mind: Since i use fluxbox, not flwm, could i set this processes in the fluxbox startup file as well?
No, *box'es are getting started in a way where those WM specific startup/autostart scripts won't be used.
/opt/bootsync.sh ,  /opt/bootlocal.sh  and especially  ~/X.d/*  should be everything you need though. Also it's independent from the Window Manager in use. So you can try another WM without missing your auto-starting programs.
Download a copy and keep it handy: Core book ;)

Offline emninger

  • Sr. Member
  • ****
  • Posts: 267
Re: Starting processes&daemons automatically
« Reply #10 on: November 01, 2015, 11:36:34 AM »
Thanks!!!

And thanks for your patience - you're a good teacher! :D