Skip to Content.

rare-dev - Re: [rare-dev] Integration of the release manager

Subject: Rare project developers

List archive


Re: [rare-dev] Integration of the release manager


Chronological Thread 
  • From: Alexander Gall <>
  • To: <>
  • Cc: <>
  • Subject: Re: [rare-dev] Integration of the release manager
  • Date: Wed, 6 Apr 2022 16:46:37 +0200

On Wed, 6 Apr 2022 16:34:19 +0200, mc36 <> said:

> hi,
> On 4/6/22 16:17, Alexander Gall wrote:
>> Hi
>>
>> On Wed, 6 Apr 2022 15:54:04 +0200, mc36 <> said:
>>
>>> On 4/6/22 15:47, Alexander Gall wrote:
>>>> Hi
>>>>
>>>> On Wed, 6 Apr 2022 14:37:06 +0200, mc36 <> said:
>>>>
>>>>> hi,
>>>>> On 4/6/22 11:42, Alexander Gall wrote:
>>>>
>>>>>>
>>>>>> Thanks, but one more thing to fix: ptyRun.bin does not return the exit
>>>>>> status of the process it's forking (it should also return a status >0
>>>>>> if the execvp() call fails). Can you please add that? I have to use
>>>>>> the pty wrapper because I'm adding a Y/N query to the tna-set-profile
>>>>>> and tna-switch-to-generation scripts to have the user confirm the
>>>>>> action.
>>>>>>
>>>>
>>>>> with this change:
>>>>> https://github.com/mc36/freeRouter/commit/106dc976b7604c1a45fb62dd3c0691da74e93f38
>>>>
>>>> Thanks. Why do we need the sleep(10)? It's pretty inconvenient.
>>>>
>>> so the idea here is that i did not wanted to keep track of the threads,
>>> whereas ensuring a single exit point from the code... the ending of the
>>> c code there only relays the stdio of the new process, and to be pretty
>>> sure that the code exits at the first appearance of return status; that's
>>> why i put it there... (an other option would be to use barriers, i know:))
>>
>> Maybe I'm missing something, but why don't you simply perform the
>> wait() after exiting the loop? Then there would be no need to sleep
>> and no need for the additional fork, I think.
>>

> so at that point, i exited the loop because select returned with hup,
> i have good chances that the child already terminated so i cannot catch
> the exit code....

I think that's not correct. wait() also works if the child has already
terminated. From wait(2):

If a child has already changed state, then these calls return immediately

And you should get the proper exit status in that case as well.

> that's why the new thread... regarding the sleep(10)
> at the end, it's just a safety and but probably 10 is a bit overkill...
> lemme reduce that to 1 too.... :)

No sleep at all should be fine.

>>>> There is another weird effect. When I use this method with my actual
>>>> script, I keep getting
>>>>
>>>> % unknown exec command entered
>>>>
>>>> I'm not sure yet what triggers this. It somehow seems related to using
>>>> "read" to get input from the user, not sure if that makes any sense. I
>>>> need to debug this further.
>>>>
>>
>>> i know this by hart, it comes from freerouter, and especially when it
>>> tries to run the command in the exec mode interpreter... could you
>>> please show me the alias you're trying to execute?
>>
>> alias exec tna-set-profile command attach shell1
>> <path-to-freertr-native>/bin/ptyRun.bin <path-to-script>/bin/set-profile
>> /etc/freertr/p4-profile
>>
> sid#show config-differences
> 2022-04-06 16:30:54.815
> alias exec tna-set-profile command attach shell1 /rtr//ptyRun.bin echo
> /bin/set-profile /etc/freertr/p4-profile

> sid#tna-set-profile asdf
> 2022-04-06 16:31:09.888
> child 3332088 created on 3
> child started
> /bin/set-profile /etc/freertr/p4-profile asdf

> child closed stdio lines

> child exited with 0 code
> sid#

> what about a live debugging session on this? letsmeet.hu/alex

Ok, I'll be there soon.

--
Alex



Archive powered by MHonArc 2.6.19.

Top of Page