PDA

View Full Version : Re: Daemonized MP3 player (linux)



seanadams
2003-11-10, 13:54
Ummm.. what's the problem here?

Just run it with & and then type exit.
It should stay running - I do it all the time.


On Monday, November 10, 2003, at 12:37 PM, Michael Herger wrote:

>>> This would be to simple to be true :-). After leaving the shell
>>> (closing
>>> my ssh connection) will it stay alive?
>>
>> It won't - but you can use some of the standard methods for keeping
>> processes around after logout: nohup, screen or vnc (in increasing
>> order of complexity).
>
> I thought of screen. Might be a possibility. VNC does not seem to be
> suitable (no X installed). I'll have a look at nohup (which I don't
> know at all) as it seems to be the least complex. Thanks!
>
> --
>
> Michael
> -----------------------------------------------------------
> http://www.jo-sac.ch/lindenberg - die JO des SAC Lindenberg
> http://www.jo-sac.ch - JO-SAC inoffiziell!
> http://photo.jo-sac.ch - mein kleines Photoalbum
>
>

mherger
2003-11-10, 14:13
> Ummm.. what's the problem here?

I want to leave the shell from which I launched my player. I'm only
connecting to it using ssh if I have to do some configuration work. But
most of the time there's nobody logged into that machine.

> Just run it with & and then type exit.
> It should stay running - I do it all the time.

First "exit" gives me the message "There are stopped jobs", but I don't
exit. Second "exit" does its job, but halts the program as well.

Michael

>>>> This would be to simple to be true :-). After leaving the shell
>>>> (closing
>>>> my ssh connection) will it stay alive?
>>>
>>> It won't - but you can use some of the standard methods for keeping
>>> processes around after logout: nohup, screen or vnc (in increasing
>>> order of complexity).
>>
>> I thought of screen. Might be a possibility. VNC does not seem to be
>> suitable (no X installed). I'll have a look at nohup (which I don't
>> know at all) as it seems to be the least complex. Thanks!

--

Michael
-----------------------------------------------------------
http://www.jo-sac.ch/lindenberg - die JO des SAC Lindenberg
http://www.jo-sac.ch - JO-SAC inoffiziell!
http://photo.jo-sac.ch - mein kleines Photoalbum

Ted Rathkopf
2003-11-10, 14:17
Aaarr, Sean Adams <sadams (AT) slimdevices (DOT) com>
What ye be sayin'?

> Ummm.. what's the problem here?
>
> Just run it with & and then type exit.
> It should stay running - I do it all the time.

Depends on the shell, and the settings for it.

For instance, in bash:

The shell exits by default upon receipt of a SIGHUP. Before
exiting, an interactive shell resends the SIGHUP to all jobs,
running or stopped. Stopped jobs are sent SIGCONT to ensure
that they receive the SIGHUP. To prevent the shell from
sending the signal to a particular job, it should be removed
from the jobs table with the disown builtin (see SHELL BUILTIN
COMMANDS below) or marked to not receive SIGHUP using disown
-h.

If the huponexit shell option has been set with shopt, bash
sends a SIGHUP to all jobs when an interactive login shell
exits.


--
Ted Rathkopf

Ted Rathkopf
2003-11-10, 14:19
Aaarr, Michael Herger <mherger (AT) jo-sac (DOT) ch>
What ye be sayin'?

>> Ummm.. what's the problem here?
>
> I want to leave the shell from which I launched my player. I'm only
> connecting to it using ssh if I have to do some configuration
> work. But most of the time there's nobody logged into that machine.
>
>> Just run it with & and then type exit.
>> It should stay running - I do it all the time.
>
> First "exit" gives me the message "There are stopped jobs", but I
> don't exit. Second "exit" does its job, but halts the program as well.
>
> Michael

Try disowning that job before exiting.

disown: disown [-h] [-ar] [jobspec ...]
By default, removes each JOBSPEC argument from the table of active
jobs. If the -h option is given, the job is not removed from the
table, but is marked so that SIGHUP is not sent to the job if the
shell receives a SIGHUP. The -a option, when JOBSPEC is not
supplied, means to remove all jobs from the job table; the -r
option means to remove only running jobs.

--
Ted Rathkopf

mherger
2003-11-10, 15:09
Ok, ok, thanks a lot, everybody! I think this is enough stuff to think
about and do some tests. But actually I first have to get my soundcard
running...

Good night,

Michael


> Aaarr, Michael Herger <mherger (AT) jo-sac (DOT) ch>
> What ye be sayin'?
>
>>> Ummm.. what's the problem here?
>>
>> I want to leave the shell from which I launched my player. I'm only
>> connecting to it using ssh if I have to do some configuration
>> work. But most of the time there's nobody logged into that machine.
>>
>>> Just run it with & and then type exit.
>>> It should stay running - I do it all the time.
>>
>> First "exit" gives me the message "There are stopped jobs", but I
>> don't exit. Second "exit" does its job, but halts the program as well.
>>
>> Michael
>
> Try disowning that job before exiting.
>
> disown: disown [-h] [-ar] [jobspec ...]
> By default, removes each JOBSPEC argument from the table of active
> jobs. If the -h option is given, the job is not removed from the
> table, but is marked so that SIGHUP is not sent to the job if the
> shell receives a SIGHUP. The -a option, when JOBSPEC is not
> supplied, means to remove all jobs from the job table; the -r
> option means to remove only running jobs.
>



--

Michael
-----------------------------------------------------------
http://www.jo-sac.ch/lindenberg - die JO des SAC Lindenberg
http://www.jo-sac.ch - JO-SAC inoffiziell!
http://photo.jo-sac.ch - mein kleines Photoalbum