Commit d83f1f7b authored by kytv's avatar kytv
Browse files

Switch from 'service' to 'systemctl' where possible

parent ad6669b7
...@@ -36,7 +36,7 @@ startup_failure() { ...@@ -36,7 +36,7 @@ startup_failure() {
"`gettext \"Something went wrong when I2P was starting. Check the logs in /var/log/i2p for more information.\"`" "`gettext \"Something went wrong when I2P was starting. Check the logs in /var/log/i2p for more information.\"`"
service i2p dump # generate a thread dump service i2p dump # generate a thread dump
sleep 5 # Give thread dump ample time to complete sleep 5 # Give thread dump ample time to complete
service i2p stop # clean up, just in case systemctl stop i2p # clean up, just in case
exit 1 exit 1
} }
...@@ -77,14 +77,14 @@ case "${1}" in ...@@ -77,14 +77,14 @@ case "${1}" in
start|restart) start|restart)
# Stop I2P before setting the router console language in case # Stop I2P before setting the router console language in case
# it pushes any updated options on quit. # it pushes any updated options on quit.
if service i2p status; then if systemctl is-active i2p; then
service i2p stop systemctl stop i2p
fi fi
# Get LANG, since we may run this from an environment that # Get LANG, since we may run this from an environment that
# doesn't have it set. # doesn't have it set.
. /etc/default/locale . /etc/default/locale
set_best_i2p_router_console_lang set_best_i2p_router_console_lang
service i2p start systemctl start i2p
wait_until_i2p_router_console_is_ready || startup_failure wait_until_i2p_router_console_is_ready || startup_failure
notify_router_console_success notify_router_console_success
wait_until_i2p_has_bootstrapped || bootstrap_failure wait_until_i2p_has_bootstrapped || bootstrap_failure
...@@ -92,7 +92,7 @@ case "${1}" in ...@@ -92,7 +92,7 @@ case "${1}" in
notify_bootstrap_success notify_bootstrap_success
;; ;;
stop) stop)
exec service i2p stop exec systemctl stop i2p
;; ;;
*) *)
echo "invalid argument '${1}'" >&2 echo "invalid argument '${1}'" >&2
......
Given /^I2P is (?:still )?(not )?running$/ do |notrunning| Given /^I2P is (?:still )?(not )?running$/ do |notrunning|
if notrunning if notrunning
!$vm.execute('service i2p status').success? !$vm.execute('systemctl is-active i2p').success?
else else
try_for(30) do try_for(30) do
$vm.execute('service i2p status').success? $vm.execute('systemctl is-active i2p').success?
end end
end end
end end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment