06-26-2008
point stdin and stdout to /dev/null
I found this on google groups:
Starting a daemon with ssh - comp.unix.admin | Google Groups
ssh server 'program </dev/null >/dev/null 2>&1 &'
that redirects the stdin to /dev/null, the stdout to /dev/null, and the stderr to stdout
This worked for me so that the remote execution kicked off the daemon and didn't wait around for output.
Will
10 More Discussions You Might Find Interesting
1. Programming
Hi,
I have to write a daemon process, which performs certain operations in the background.
Now since it performs operations in the background, it should not display anything to the standard output.
The problem is that it still displays, text on standard output.
Can anyone tell me (it is... (2 Replies)
Discussion started by: s_chordia
2 Replies
2. Programming
This is gonna seem really silly to almost evryone here - but I need to know :
what is a daemon process?
Thanks (6 Replies)
Discussion started by: Kanu77
6 Replies
3. Shell Programming and Scripting
Hello all,
How do I start a background process and save the process id to a file on my system. For example %wait 5 & will execute and print the process id. I can't figure out how to get it to a file. I've tried: > filename 0>filename 1>filename.
Any assistance is most appreciated.
Thanks,
Jim... (10 Replies)
Discussion started by: jleavitt
10 Replies
4. Linux
how i will write the daemon process,if any body have sample daemon process send me. (1 Reply)
Discussion started by: suresh_rupineni
1 Replies
5. UNIX for Dummies Questions & Answers
I'm running a FreedBSD server with mysql 4.1. When I start mysqld via the command:
# /usr/local/bin/safe_mysqld --user=mysql
it starts the mysql db (I know because the websites are running off of it) but does not return to a prompt, it will let me type but will not respond unless I restart... (15 Replies)
Discussion started by: unispace
15 Replies
6. SCO
Hi
We are running SCO ver 5. Recently the cron daemon stopped running on its own. How do I find out why? How do I restart/stop it?
I typed cron but it didn't work. Will rebooting it do the trick or can I manually start and stop the cron daemon?
Please help.
Thanks & Regards. (0 Replies)
Discussion started by: othman
0 Replies
7. Shell Programming and Scripting
I'm trying to ssh into a remote server, run a script which may or may not start a nohup'd background process and then exit leaving the process running on the remote server. I'm looping through a number of servers to do this but the script hangs as soon as it comes to a server where the remote... (3 Replies)
Discussion started by: Steve_H
3 Replies
8. Shell Programming and Scripting
Hey all, I need to launch a script from within 2 other scripts that can run independently of the two parent scripts... Im having a hard time doing this, if anyone knows how please let me know.
More detail.
ScriptA (bash), ScriptB (ksh), ScriptC (bash)
ScriptA, launches ScriptB
ScirptB,... (7 Replies)
Discussion started by: trey85stang
7 Replies
9. Shell Programming and Scripting
I have a script that reads a file containing a list of server names. It's suppose to loop through the list of names and execute a command on the remote server using ssh. It processes the ssh command for the first server in the list and then exits. Here's the code:
#!/bin/bash
... (2 Replies)
Discussion started by: westmoreland
2 Replies
10. Programming
I wish to make a process run in the background, but only one instance of it, and not many,
so when the program is loaded, it has to check whether another instance of the same
program is running and if so to exit. How do I do this ? (4 Replies)
Discussion started by: sundaresh
4 Replies
LEARN ABOUT OSX
dbd::gofer::transport::stream
DBD::Gofer::Transport::stream(3) User Contributed Perl Documentation DBD::Gofer::Transport::stream(3)
NAME
DBD::Gofer::Transport::stream - DBD::Gofer transport for stdio streaming
SYNOPSIS
DBI->connect('dbi:Gofer:transport=stream;url=ssh:username@host.example.com;dsn=dbi:...',...)
or, enable by setting the DBI_AUTOPROXY environment variable:
export DBI_AUTOPROXY='dbi:Gofer:transport=stream;url=ssh:username@host.example.com'
DESCRIPTION
Without the "url=" parameter it launches a subprocess as
perl -MDBI::Gofer::Transport::stream -e run_stdio_hex
and feeds requests into it and reads responses from it. But that's not very useful.
With a "url=ssh:username@host.example.com" parameter it uses ssh to launch the subprocess on a remote system. That's much more useful!
It gives you secure remote access to DBI databases on any system you can login to. Using ssh also gives you optional compression and many
other features (see the ssh manual for how to configure that and many other options via ~/.ssh/config file).
The actual command invoked is something like:
ssh -xq ssh:username@host.example.com bash -c $setup $run
where $run is the command shown above, and $command is
. .bash_profile 2>/dev/null || . .bash_login 2>/dev/null || . .profile 2>/dev/null; exec "$@"
which is trying (in a limited and fairly unportable way) to setup the environment (PATH, PERL5LIB etc) as it would be if you had logged in
to that system.
The ""perl"" used in the command will default to the value of $^X when not using ssh. On most systems that's the full path to the perl
that's currently executing.
PERSISTENCE
Currently gofer stream connections persist (remain connected) after all database handles have been disconnected. This makes later
connections in the same process very fast.
Currently up to 5 different gofer stream connections (based on url) can persist. If more than 5 are in the cache when a new connection is
made then the cache is cleared before adding the new connection. Simple but effective.
TO DO
Document go_perl attribute
Automatically reconnect (within reason) if there's a transport error.
Decide on default for persistent connection - on or off? limits? ttl?
AUTHOR
Tim Bunce, <http://www.tim.bunce.name>
LICENCE AND COPYRIGHT
Copyright (c) 2007, Tim Bunce, Ireland. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.
SEE ALSO
DBD::Gofer::Transport::Base
DBD::Gofer
perl v5.16.2 2010-12-21 DBD::Gofer::Transport::stream(3)