Skip to content

Commit

Permalink
[change] Changed naming of agent file and init for consistency
Browse files Browse the repository at this point in the history
The name "openwisp_config" wasn't consistent with
all the other files of the package.

A symbolic link to the old files is provided for
backward compatibility.
  • Loading branch information
nemesifier committed May 25, 2024
1 parent 985f300 commit fd7b978
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 11 deletions.
12 changes: 6 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ and `Compiling a custom OpenWRT image`_.
Once installed *openwisp-config* needs to be configured (see `Configuration options`_)
and then started with::

/etc/init.d/openwisp_config start
/etc/init.d/openwisp-config start

To ensure the agent is working correctly find out how to perform debugging in
the `Debugging`_ section.
Expand Down Expand Up @@ -188,7 +188,7 @@ If the test fails, the backup is restored and the agent will log the failure via
Disable testing
^^^^^^^^^^^^^^^

To disable this feature, set the ``test_config`` option to ``0``, then reload/restart *openwisp_config*.
To disable this feature, set the ``test_config`` option to ``0``, then reload/restart *openwisp-config*.

Define custom tests
^^^^^^^^^^^^^^^^^^^
Expand Down Expand Up @@ -238,7 +238,7 @@ In some cases it could be necessary to ensure that some configuration sections w
overwritten by the controller.

These settings are called "unmanaged", in the sense that they are not managed remotely.
In the default configuration of *openwisp_config* there are no unmanaged settings.
In the default configuration of *openwisp-config* there are no unmanaged settings.

Example unmanaged settings::

Expand Down Expand Up @@ -297,7 +297,7 @@ Complete example:
EOF
# make script executable
chmod +x /usr/sbin/my-pre-reload-hook
# reload openwisp_config by using procd's convenient utility
# reload openwisp-config by using procd's convenient utility
reload_config
post-reload-hook
Expand Down Expand Up @@ -468,11 +468,11 @@ If you are in doubt openwisp-config is running at all, you can check with::
You should see something like::
3800 root 1200 S {openwisp_config} /bin/sh /usr/sbin/openwisp_config --url https://openwisp2.mydomain.com --verify-ssl 1 --consistent-key 1 ...
3800 root 1200 S {openwisp-config} /bin/sh /usr/sbin/openwisp-config --url https://openwisp2.mydomain.com --verify-ssl 1 --consistent-key 1 ...
You can inspect the version of openwisp-config currently installed with::
openwisp_config --version
openwisp-config --version
Quality Assurance Checks
------------------------
Expand Down
16 changes: 14 additions & 2 deletions openwisp-config/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ define Package/openwisp-config/install

$(INSTALL_BIN) \
files/openwisp.agent \
$(1)/usr/sbin/openwisp_config
$(1)/usr/sbin/openwisp-config

$(INSTALL_BIN) \
files/openwisp.init \
$(1)/etc/init.d/openwisp_config
$(1)/etc/init.d/openwisp-config

$(INSTALL_CONF) files/openwisp.config \
$(1)/etc/config/openwisp
Expand Down Expand Up @@ -94,4 +94,16 @@ define Package/openwisp-config/install
$(CP) ../VERSION $(1)/usr/lib/openwisp-config/
endef

# for backward compatibility
define Package/openwisp-config/postinst
#!/bin/sh
if [ ! -L /usr/sbin/openwisp_config ]; then
ln -s /usr/sbin/openwisp-config /usr/sbin/openwisp_config
fi

if [ ! -L /etc/init.d/openwisp_config ]; then
ln -s /etc/init.d/openwisp-config /etc/init.d/openwisp_config
fi
endef

$(eval $(call BuildPackage,openwisp-config))
2 changes: 1 addition & 1 deletion openwisp-config/files/openwisp.agent
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ print_error_logs() {
# "\n[truncated]" is appended to the logs which adds
# another 13 bytes.
max_log_bytes=1011
# Save openwisp_config related logs to a temporary file
# Save openwisp-config related logs to a temporary file
logread -e openwisp >"$CONFIG_ERROR_LOG"
# Get the line number of the last configuration update
last_update_line_no=$(
Expand Down
2 changes: 1 addition & 1 deletion openwisp-config/files/openwisp.init
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
START=99
USE_PROCD=1
}
PROG="/usr/sbin/openwisp_config"
PROG="/usr/sbin/openwisp-config"
PROG_NAME="OpenWISP config agent"
CONTROL_FILE=/tmp/openwisp/applying_conf

Expand Down
2 changes: 1 addition & 1 deletion openwisp-config/files/sbin/openwisp-reload-config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
# openwisp_config variant of /sbin/reload_config
# openwisp-config variant of /sbin/reload_config

rm -rf /var/run/config.check
mkdir -p /var/run/config.check
Expand Down

0 comments on commit fd7b978

Please sign in to comment.