Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

openwrt: convert to procd #7

Merged
merged 2 commits into from
Apr 12, 2024
Merged

Conversation

xabolcs
Copy link
Contributor

@xabolcs xabolcs commented Mar 4, 2020

procd is the new process management daemon and supports a new style init script.

@xabolcs
Copy link
Contributor Author

xabolcs commented Mar 5, 2020

I tested only the snapclient.init part.

@xabolcs
Copy link
Contributor Author

xabolcs commented May 1, 2020

After commit badaix/snapcast@a2311df I'm wondering how to take the logging defaults into account from /etc/default/snap{client,server} in the init files.

procd have to run the programs in foreground. Therefore I have to set the logging sink to system (and also wipe out all -d and --daemon argument from SNAPSERVER_OPTS).

Should I override it like the --daemon? Should I create a patches directory and patch debian/snap{client,server}.default to add the log sink param to SNAPSERVER_OPTS?

@xabolcs xabolcs force-pushed the branch-openwrt-procd branch 2 times, most recently from 693285b to 2c90949 Compare May 10, 2020 20:24
@xabolcs
Copy link
Contributor Author

xabolcs commented May 10, 2020

... I'm wondering how to take the logging defaults into account ...

I decided to override them with --logging.sink system and --logsink system.

Filtering out -d and --daemon is still TODO.

@badaix
Copy link
Owner

badaix commented May 14, 2020

Is it recommended by OpenWRT to migrate to procd?
And yes: using system as log sink is the proper way, what about -d? Is it set somewhere?

@xabolcs
Copy link
Contributor Author

xabolcs commented May 14, 2020

As this is the new init format, I think it's recommended. Just see the related commits in openwrt/packages repository!
I have to mention that I was unable to find an explicit recommendation on OpenWrt Wiki or in CONTRIBUTING.md.

I want the -d filter stuff because the old behavior automatically adds it to the options:

SNAPCLIENT_OPTS="-d $SNAPCLIENT_OPTS"

In turn, it forces to daemonize the process.

That's why I want to force running the process in the foreground ...

@xabolcs
Copy link
Contributor Author

xabolcs commented Aug 19, 2020

With the upcoming v0.21 version is it feasible to refresh this PR and upstream Snapcast to OpenWrt Packages?

@xabolcs xabolcs force-pushed the branch-openwrt-procd branch from 2c90949 to d40f7c1 Compare January 19, 2021 08:48
@db4rne
Copy link

db4rne commented Mar 11, 2021

Hi, the fork of 21.0x already happened, maybe we can still upstream this into OpenWRT packages? is there any argument against it? I'd love to help.

@db4rne
Copy link

db4rne commented Apr 2, 2021

I have started to include this into openwrt, if any of you would like to test and/or change something please contact me. you can find my branch for the snapcast package here: https://github.com/db4rne/packages/tree/snapcast

it's just the makefile from this repo (changed for version 0.24), and the procd-scripts from this PR.

@xabolcs
Copy link
Contributor Author

xabolcs commented Jul 23, 2021

@db4rne , it would be nice to include it in OpenWrt Packages repo.

I think, this PR is ready to use.

@xabolcs xabolcs force-pushed the branch-openwrt-procd branch from d40f7c1 to c57bd3e Compare January 13, 2022 16:37
@xabolcs
Copy link
Contributor Author

xabolcs commented Feb 5, 2023

master updated to v0.27.0, but develop was left behind. Should I re-target the PR?

@xabolcs xabolcs changed the base branch from develop to master February 16, 2023 15:16
@xabolcs
Copy link
Contributor Author

xabolcs commented Feb 16, 2023

Retargeted the PR to master.

xabolcs added 2 commits April 15, 2023 10:46
with default values of 3600s threshold, 5s timeout and 5 respawn retry

See "Service Parameters" at [0]

0: https://openwrt.org/docs/guide-developer/procd-init-scripts#service_parameters
@xabolcs xabolcs force-pushed the branch-openwrt-procd branch from 4901ea7 to 8063562 Compare April 15, 2023 08:46
@davidandreoletti
Copy link
Contributor

davidandreoletti commented Mar 29, 2024

@xabolcs With #29, snapcast can be built again for OpenWRT 23.05 and current SNAPSHOT.

Have you tried this PR with OpenWRT 23.05 yet ?

I am keen to help test this PR on OpenWRT snapshot.

@davidandreoletti
Copy link
Contributor

Is it recommended by OpenWRT to migrate to procd?

@badaix Yes, procd is THE startup/process management facility for OpenWRT.

@xabolcs
Copy link
Contributor Author

xabolcs commented Mar 29, 2024

Have you tried this PR with OpenWRT 23.05 yet ?

I tried this PR long time ago, because of the debian files.
But I use the init files directly with OpenWrt SNAPSHOT and 23.05.

@davidandreoletti
Copy link
Contributor

But I use the init files

@xabolcs Do you mean the init files using procd (from this PR) were copied to your OpenWRT 23.05/snapshot device and are working as intended ?

@xabolcs
Copy link
Contributor Author

xabolcs commented Mar 30, 2024

Yup!

Just save those init files as /etc/init.d/snap{client,server} and they will be ready to use.

@davidandreoletti
Copy link
Contributor

davidandreoletti commented Mar 30, 2024

@xabolcs Thanks!

@badaix: @xabolcs confirmed the procd enabled init files in this PR are working on the latest OpenWRT stable and snapshot release.

Benefits for snapcast: better integration with OpenWRT's system service

  • enabling auto start after boot
  • auto restart the snapcast binaries upon crash (happens on v0.28.beta1)
  • running status
  • restart,
  • etc

Would you mind merging this PR please ?

@davidandreoletti
Copy link
Contributor

@badaix This PR will take 4 min of your time max to review its usefullness/merge.

@badaix badaix merged commit 29a5dae into badaix:master Apr 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants