Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

olsrd: don't start service when ignored #780

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion olsrd/files/olsrd.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
config olsrd
config olsrd olsrd
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the second olsrd word a typo ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah wait, I understand how, it is because UCI expects olsrd.olsrd.ignore=true

# uncomment the following line to use a custom config file instead:
#option config_file '/etc/olsrd.conf'
option ignore 0

config LoadPlugin
option library 'olsrd_arprefresh.so.0.1'
Expand Down
7 changes: 5 additions & 2 deletions olsrd/files/olsrd4.init
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,20 @@ boot()
start_service() {
olsrd_generate_config $OLSRD

procd_open_instance

config_load olsrd
local _respawn_threshold
local _respawn_timeout
local _respawn_retry
local _ignore

config_get _respawn_threshold procd respawn_threshold 3600
config_get _respawn_timeout procd respawn_timeout 15
config_get _respawn_retry procd respawn_retry 0
config_get_bool _ignore olsrd ignore 0

[ $_ignore -ne 0 ] && return

procd_open_instance
procd_set_param command "$BIN"
procd_append_param command -f ${CONF}
procd_append_param command -nofork
Expand Down
3 changes: 2 additions & 1 deletion olsrd/files/olsrd6.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
config olsrd
config olsrd olsrd
# uncomment the following line to use a custom config file instead:
#option config_file '/etc/olsrd6.conf'
option ignore 0

config LoadPlugin
option library 'olsrd_txtinfo.so.1.1'
Expand Down
7 changes: 5 additions & 2 deletions olsrd/files/olsrd6.init
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,20 @@ boot()
start_service() {
olsrd_generate_config $OLSRD

procd_open_instance

config_load olsrd6
local _respawn_threshold
local _respawn_timeout
local _respawn_retry
local _ignore

config_get _respawn_threshold procd _respawn_threshold 3600
config_get _respawn_timeout procd respawn_timeout 15
config_get _respawn_retry procd respawn_retry 0
config_get_bool _ignore olsrd ignore 0

[ $_ignore -ne 0 ] && return

procd_open_instance
procd_set_param command "$BIN"
procd_append_param command -f ${CONF}
procd_append_param command -nofork
Expand Down