In bash, use $!
Mohamed Lrhazi wrote:
> I am sorry... I was mistaken... thought it was straightforward.... like:
>
> start-my-process&
> mypid=$SOME_SPECIAL_SHELL_VAR
>
> but it looks like there is no such env var... or is there? i was
> thinking $$, but of course that "my own pid"
>
> My shell, Zsh, does display the process ID of the just-launched-job,
> but did not check the man page if that pid is also stored in an env or
> not.
>
> Mohamed.
>
> On Mon, Jan 5, 2009 at 11:04 AM, Adam Tauno Williams
> <adam@...> wrote:
>
>> On Mon, 2009-01-05 at 09:18 -0500, Mohamed Lrhazi wrote:
>>
>>> From a Shell script there is no way to capture launched process id??
>>>
>> "there is no way (AFAIK) to capture the PID" :)
>>
>> Emphasis on the AFAIK, although I've been doing the UNIX thing for 1.6
>> decades (which is scary to think about).
>>
>>
>>> On 1/5/09, Adam Tauno Williams <adam@...> wrote:
>>>
>>>> On Mon, 2009-01-05 at 00:02 -0600, Devin Venable wrote:
>>>>
>>>>> Any insights into running a jython script as a daemon on Linux? I
>>>>> realize that you cannot spawn processes, so true forking is out of the
>>>>> question.
>>>>> Let me retrace my steps, and jump in if you see a place to make a
>>>>> suggestion.
>>>>> 1. I wrote a SimpleXMLRPCServer that runs forever.
>>>>> 2. For my purposes, I want to run it as a Linux service, so I worked
>>>>> up an init script, but was quickly reminded that, to run as a service,
>>>>> the program should fork and exit.
>>>>>
>>>> I've written long-running Jython processes that sit as services on
>>>> LINUX. I just start them with "nohup {jythonApp} &". Seems to work OK.
>>>> Only downside is that there is no way (AFAIK) to capture the PID of the
>>>> new process to store in /var/run/{jythonApp}.pid. So "service
>>>> {jythonApp} stop" doesn't work.
>>>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> Jython-users mailing list
>> Jython-users@...
>> https://lists.sourceforge.net/lists/listinfo/jython-users
>>
>>
>
>
>
>
|