apinger: Broken default behavior and daemon status
Nobody has claimed this yet.
- Dominant language
- Makefile
- Stars
- 4.6k
- Forks
- 4k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 134
Description
Maintainer: @samm-git @jempatel
Environment:
model: wndr3800ch
openwrt (`master` branch): fb15cb4ce9559021d463b5cb3816d8a9eeb8f3f9
opkg (`master` branch): c8fcec9371fff43c0b62a58ec2064e83fe39f403
Description:
Related to: https://github.com/openwrt/packages/pull/18913 https://github.com/openwrt/packages/pull/19073
apinger no longer reads from the original default config location: /etc/apinger.conf instead it defaults to new instance vars and UCI configuration defined in /etc/config/apinger and leverages a default template inside the init script (https://github.com/openwrt/packages/blob/573355dedd1229e62afe2fdee9fa48ef4bbd587f/net/apinger/files/apinger.init#L131-L179) This configuration seems to make assumptions about interface names defaulting to wan:
~# cat /etc/config/apinger
config interface 'wan'
option debug '0'
option status_interval '5'
#config interface 'wan2'
# option debug '0'
# option status_interval '5'
# delay is in ms
#config alarm_delay 'delay200'
# option delay_low '100'
# option delay_high '200'
# loss is in %
#config alarm_loss 'loss50'
# option percent_low '30'
# option percent_high '50'
#config target 'target1'
# option interface 'wan'
# option address '8.8.8.8'
# option alarm_delay 'a1'
# option alarm_loss 'loss50'
# option probe_interval '5'
#config target 'target2'
# option interface 'wan2'
# option address '8.8.8.8'
The service is also unable to correctly track its status if the process dies:
~$ service apinger start
~$ service apinger status
running
Then in syslog since I dont have a wan interface in my configuration the service logs:
~$ tail /var/log/messages
...
Dec 27 11:12:59 OpenWrt apinger[3014]: [Dec 27 11:12:59] Starting Alarm Pinger, apinger(3014)
Dec 27 11:12:59 OpenWrt apinger[3014]: [Dec 27 11:12:59] No usable targets found, exiting
service still thinks apinger running even though its not:
~# ps | grep -i apinger
3303 root 1316 S grep -i apinger
~# service apinger status
running
It also seems to unable to find a command if the daemon is hard stopped and then restart is issued:
~# service apinger stop
~# service apinger status
inactive
~# service apinger restart
Command failed: Not found
~# service apinger status
running
It seems like the most recent changes are around supporting hotplugs and rrd (https://github.com/openwrt/packages/pull/18913 https://github.com/openwrt/packages/pull/19073) but should this be considered a separate flavor of the package all together instead of the default package and behavior? My concern is it seems like a radical departure from the original service and pkg functionality considering the size of the patches to apinger codebase. This was even called out https://github.com/openwrt/packages/pull/19073#issuecomment-1198687893 but the packages + init script seems to be the same between the two packages (apinger and apinger-rdd). I also get an directory in the root of my filesystem which I have no use for /apinger/rrd:
~# ls -lah /apinger/
drwxr-xr-x 3 root root 0 Dec 27 07:40 .
drwxr-xr-x 1 root root 0 Dec 27 07:40 ..
drwxr-xr-x 2 root root 0 Dec 27 07:40 rrd
Questions
- Would it be possible to retain a more simplistic
apingerservice for the non rrd flavor? The current state of apinger breaks the default behavior of previous versions. - Is there anyway to pass a configuration file to the
apingerservice in its current state? I dont believe there is since the existing service only provides getting a subset of config.
Any help would be appreciated!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with net/apinger/files/apinger.init and the generated /etc/config/apinger configuration referenced in the issue. Reproduce the start, status, stop, and restart commands on the stated OpenWrt environment, then compare the daemon and service results with the syslog output. Done means the default configuration and daemon status behavior are explicitly resolved, including the non-RRD questions.
Written by the indexing model from the issue text.
Assessment
- Domain
- devops, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100