LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-08-2011, 03:38 PM   #1
nathanjell
LQ Newbie
 
Registered: Oct 2011
Distribution: Fedora 15 64-bit
Posts: 3

Rep: Reputation: Disabled
Running process as background -- without output


Ok so I'm running Fedora 15, and want to run a command at startup. To do this, I think I'll use cron, and configure the task through gnome-schedule. The command I wish to run is deluge-web.

So in short, I want to run the command without having to have the shell open, and without having any output. I really have no idea what to do. I've tried running

Code:
deluge-web&
but it still brings up the shell. It's not like there's any output anyways. I'm also thinking of maybe writing a simple sh/zsh script to run at startup through cron.

Any ideas on how to do this?
 
Old 10-09-2011, 01:13 AM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian + kde 4 / 5
Posts: 6,834

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
cron is really there for running short-term commands regularly at specified intervals, and isn't really designed for autostarting programs. I'd think you'd be better off simply writing a start-up wrapper script and use your desktop's autostart feature to launch it.

As for running it silently, the wrapper script will act as the shell, so you probably won't get any console window. And error messages can be redirected away in any case.

Code:
#!/bin/bash

deluge-web "$@" 2>/dev/null &

exit 0
The $@ will allow you to pass any options to the program through the script's command line, should you need it.
 
Old 10-09-2011, 01:23 AM   #3
nathanjell
LQ Newbie
 
Registered: Oct 2011
Distribution: Fedora 15 64-bit
Posts: 3

Original Poster
Rep: Reputation: Disabled
This looks really good, I think it should work. I just want to start Deluge at startup, but don't want the whole program open, you know?

Ayway, do you know of a good startup manager? Fedora 15 (to my knowledge) doesn't include one at all, which is why I was using cron. I know back in the Ubuntu based realm, most if not all have one included. Which is why I'm surprised when I look everywhere for the startup manager in FC15!!! I though Fedora was more geared towards the workstations and servers the way Debian is, so you'd think it should have one included.

Edit:
Sorry about that, I should have googled more. Figured that out, now just to try out the script. I guess Fedora does come with gnome-session-properties, just no icon.

Last edited by nathanjell; 10-09-2011 at 02:07 AM. Reason: Answered my own question
 
Old 10-09-2011, 12:42 PM   #4
nathanjell
LQ Newbie
 
Registered: Oct 2011
Distribution: Fedora 15 64-bit
Posts: 3

Original Poster
Rep: Reputation: Disabled
Looks good!

Tried out the script, and it looks like everything is good. I think the last thing I'll do is, just for fun, instead of redirecting stderr to /dev/null, maybe I'll redirect stdout and stderr to a log files, just cause I'd like to see what was going on if there was an error. Thanks for the help!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Regaining output from a background process the_holysmoke Linux - Newbie 4 03-11-2011 07:48 PM
Running process in background aggrishabh Linux - Newbie 12 01-19-2011 01:06 PM
Process running in background baddah Linux - General 3 02-22-2008 01:44 AM
Is there a way to show the output of background process? nadavvin Linux - General 1 05-28-2007 12:21 AM
background running process elbriga Programming 2 09-21-2004 07:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration