Can't start addrwatch service

Hi,

I'm trying to start the addrwatch service through its init script using PROCD. I can run the program manually with this command:

/usr/sbin/addrwatch --output /var/log/addrwatch --hashsize 1024 --ratelimit -1 br-lan

But when I run /etc/init.d/addrwatch start nothing happends. The service isn't started. I have enabled PROCD_DEBUG and this is the output I get on launching the service:

# /etc/init.d/addrwatch start
{ "name": "addrwatch", "script": "\/etc\/init.d\/addrwatch", "instances": { "instance1": { "command": [ "\/usr\/sbin\/addrwatch", "--output", "\/var\/log\/addrwatch", "--hashsize", "1024", "--ratelimit", "-1", "br-lan" ], "netdev": [ "br-lan" ], "respawn": [ "3600", "5", "5" ], "triggers": [ [ "interface.*", [ "if", [ "eq", "interface", "lan" ], [ "run_script", "\/etc\/init.d\/addrwatch", "reload" ] ], 1000 ] ], "pidfile": "\/var\/run\/addrwatch.pid" } }, "triggers": [ [ "config.change", [ "if", [ "eq", "package", "addrwatch" ], [ "run_script", "\/etc\/init.d\/addrwatch", "reload" ] ], 1000 ] ], "data": { } }

It seems right to me, but the service isn't started. I can't see anything about addrwatch in logread.

This is the config file for addrwatch:

config addrwatch
        option disabled '0'
        list interface 'lan'
        option syslog '0'
        option output '/var/log/addrwatch'
        option ratelimit '-1'

Do you know what's wrong? How can I start the service with the init script?

Kind regards,

1 Like

Hi,
have you got any solution to this issue? I'm stuck at same position and can't start this service with the init script.
Thanks.

The default config file enables option syslog which caused addrwatch to crash. I found a solution by explicitly disabling syslog in /etc/config/addrwatch; syslog doesn't work when you don't have a syslog daemon running but only using OOB logging facilities. Leaving option syslog enabled causes addrwatch to crash. I configured a flat logfile instead:

config addrwatch
	option disabled '0'
	list interface 'lan'
	option syslog '0'
	option verbose '1'
	option output '/var/log/addrwatch'

Also I applied this patch to /etc/init.d/addrwatch to correct some errors in the spelling or handling of comandline options:

40,47c40,47
< 	[ "$syslog" -eq 1 ] && procd_append_param command --syslog
< 	[ -n "$output" ] && procd_append_param command --output "$output"
< 	[ "$quiet" -eq 1 ] && procd_append_param command --quiet
< 	[ "$verbose" -eq 1 ] && procd_append_param command --verbose
< 	[ "$ipv4only" -eq 1 ] && procd_append_param command --ipv4only
< 	[ "$ipv6only" -eq 1 ] && procd_append_param command --ipv6only
< 	[ -n "$hashsize" ] && procd_append_param command --hashsize "$hashsize"
< 	[ -n "$ratelimit" ] && procd_append_param command --ratelimit "$ratelimit"
---
> 	[ "$syslog" -eq 1 ] && procd_append_param command "--syslog"
> 	[ -n "$output" ] && procd_append_param command "--output=$output"
> 	[ "$quiet" -eq 1 ] && procd_append_param command "--quiet"
> 	[ "$verbose" -eq 1 ] && procd_append_param command "--verbose"
> 	[ "$ipv4only" -eq 1 ] && procd_append_param command "--ipv4-only"
> 	[ "$ipv6only" -eq 1 ] && procd_append_param command "--ipv6-only"
> 	[ -n "$hashsize" ] && procd_append_param command "--hashsize=$hashsize"
> 	[ -n "$ratelimit" ] && procd_append_param command "--ratelimit=$ratelimit"
1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.