Skip to Content.

rare-dev - Re: [rare-dev] nix packaging

Subject: Rare project developers

List archive


Re: [rare-dev] nix packaging


Chronological Thread 
  • From: <>
  • To: <>
  • Cc: "" <>
  • Subject: Re: [rare-dev] nix packaging
  • Date: Mon, 16 Aug 2021 10:03:23 +0200
  • Authentication-results: mx1.switch.ch; x-trusted-ip=pass

On Mon, 16 Aug 2021 08:40:31 +0200, mc36 <> said:

> and another, the
> /nix/store/l1wlg9llnjdg549kw82szwj3pchqhkw5-freerouter-21.04.06/bin/freerouter
> script should look like:
> cd /rtr/
> while (true); do
> java -Xmx2g -jar /rtr/rtr.jar router /rtr/rtr-
> if [ $? -eq 4 ] ; then
> sync
> reboot -f
> else
> sleep 1
> fi
> sleep 1
> done

The reboot is done by the ExecStopPost handler of the service:

$ cat /nix/store/vc8pxy21iynvqkgy6r8f2q46yfxlqr1m-freertr-exec-stop-post
#!/nix/store/a3fc4zqaiak11jks9zd579mz5v0li8bg-bash-4.4-p23/bin/bash
if [ $EXIT_STATUS -eq 4 ]; then
echo "cold reload requested by freeRtr, initiating reboot"
/nix/store/q6ylicsava582g55mdx0788yg2fib7js-systemd-246.6/bin/systemctl
reboot
fi
exit 0

I have also set

Restart=on-failure

The difference to your method is that the service doesn't restart if
it exits with status 0. I guess we need to decide whether the user
should be able to stop the service from the CLI without an automatic
restart or reboot.

--
Alex

> On 8/15/21 5:56 AM, mc36 wrote:
>> one more thing: the p4 user have no sudo capabilities...
>>
>> On 8/15/21 5:39 AM, mc36 wrote:
>>> hello,
>>> i just noticed that poznan runs the nix version of the rare builds....
>>> checked around and found the following, please correct and rebuild:
>>> - please use the latest greatest available jvm for the built blob... at
>>> the moment you build with jvm8 whereas the latest stable is jvm16... (if
>>> that is not yet nix-ized, then
>>> jvm11 should work fine)
>>> - please compile freerouter to rtr.jar instead of freerouter.jar... the
>>> name have importance in the autoupgrade process...
>>> otherwise i found the blob convenient, great work!
>>> thanks,
>>> cs
>>>
>>>
>>> POZ0001#show platform
>>> freeRouter v21.4.6-cur, done by cs@nop.
>>>
>>> name: POZ0001
>>> hwid: wedge100bf32x
>>> uptime: since 2021-08-15 05:33:43, for 00:00:34
>>> hwcfg: /etc/freertr/rtr-hw.txt
>>> swcfg: /etc/freertr/rtr-sw.txt
>>> cpu: 8*amd64
>>> mem: free=131m, max=1908m, used=794m
>>> host: Linux v4.19.0-16-amd64
>>> java: Oracle Corporation v1.8.0_272 @
>>> /nix/store/mlhbfwpig3yadxvcxb1055qcqbpjfdx5-openjdk-headless-8u272-b10-jre/lib/openjdk/jre
>>> jspec: Oracle Corporation (Java Platform API Specification) v1.8
>>> vm: Oracle Corporation (OpenJDK 64-Bit Server VM) v25.272-b10
>>> vmspec: Oracle Corporation (Java Virtual Machine Specification) v1.8
>>> class: v52.0 @
>>> /nix/store/l1wlg9llnjdg549kw82szwj3pchqhkw5-freerouter-21.04.06/share/java/freerouter.jar
>>>
>>> POZ0001#



Archive powered by MHonArc 2.6.19.

Top of Page