Skip to content

Commit

Permalink
ensure that weewx runs after install. debian behavior is not the same…
Browse files Browse the repository at this point in the history
… as redhat or suse.
  • Loading branch information
matthewwall committed Jul 4, 2024
1 parent 5e41371 commit c7ebf98
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 2 additions & 0 deletions pkg/changelog.el
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
* Thu Jul 04 2024 Matthew Wall <mwall.weewx@gmail.com> - 5.1.0-2
- ensure weewxd runs after install
* Thu Jul 04 2024 Matthew Wall <mwall.weewx@gmail.com> - 5.1.0-1
- new upstream release
* Thu Jul 04 2024 Matthew Wall <mwall.weewx@gmail.com> - 5.1.0b6-1
Expand Down
2 changes: 2 additions & 0 deletions pkg/changelog.suse
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
* Thu Jul 04 2024 Matthew Wall <mwall.weewx@gmail.com> - 5.1.0-2
- ensure weewx runs after install
* Thu Jul 04 2024 Matthew Wall <mwall.weewx@gmail.com> - 5.1.0-1
- new upstream release
* Thu Jul 04 2024 Matthew Wall <mwall.weewx@gmail.com> - 5.1.0b6-1
Expand Down
8 changes: 3 additions & 5 deletions pkg/debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,7 @@ case "$1" in
if [ "$2" != "" ]; then
# this is an upgrade, so see if weewx is already running
num_weewxd=$(count_instances)
echo "Found $num_weewxd running instances of weewxd"
# this is an upgrade, so ensure that weewx is not running
stop_old_weewxd $pid1
fi
Expand Down Expand Up @@ -566,11 +567,8 @@ case "$1" in
set_config_permissions
setup_init $pid1
enable_weewxd $pid1
if [ $num_weewxd -gt 0 ]; then
# if this is a new install, start weewx no matter what. if this
# is an upgrade, start weewx only if it was running before.
start_weewxd $pid1
fi
# always try to start weewx
start_weewxd $pid1
;;

abort-remove)
Expand Down
3 changes: 2 additions & 1 deletion pkg/weewx.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@ num_weewxd=1
if [ $1 -gt 1 ]; then
# this is an upgrade, so see if weewx is already running
num_weewxd=$(count_instances)
echo "Found $num_weewxd running instances of weewxd"
# this is an upgrade, so ensure that weewx is not running
stop_old_weewxd $pid1
fi
Expand All @@ -452,7 +453,7 @@ precompile
set_config_permissions
setup_init $pid1
enable_weewxd $pid1
if [ $num_weewxd -gt 0 ]; then
if [ "$num_weewxd" != "0" ]; then
# if this is a new install, start weewx no matter what. if this
# is an upgrade, start weewx only if it was running before.
start_weewxd $pid1
Expand Down

0 comments on commit c7ebf98

Please sign in to comment.