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() {
"`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
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
}
......@@ -77,14 +77,14 @@ case "${1}" in
start|restart)
# Stop I2P before setting the router console language in case
# it pushes any updated options on quit.
if service i2p status; then
service i2p stop
if systemctl is-active i2p; then
systemctl stop i2p
fi
# Get LANG, since we may run this from an environment that
# doesn't have it set.
. /etc/default/locale
set_best_i2p_router_console_lang
service i2p start
systemctl start i2p
wait_until_i2p_router_console_is_ready || startup_failure
notify_router_console_success
wait_until_i2p_has_bootstrapped || bootstrap_failure
......@@ -92,7 +92,7 @@ case "${1}" in
notify_bootstrap_success
;;
stop)
exec service i2p stop
exec systemctl stop i2p
;;
*)
echo "invalid argument '${1}'" >&2
......
Given /^I2P is (?:still )?(not )?running$/ do |notrunning|
if notrunning
!$vm.execute('service i2p status').success?
!$vm.execute('systemctl is-active i2p').success?
else
try_for(30) do
$vm.execute('service i2p status').success?
$vm.execute('systemctl is-active i2p').success?
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