Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eepm
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
eepm
Commits
b38de5e8
Commit
b38de5e8
authored
Sep 01, 2021
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm-release_upgrade: add checking for local console, for screen using, for logind
parent
d5a55707
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
0 deletions
+45
-0
epm-release_upgrade
bin/epm-release_upgrade
+45
-0
No files found.
bin/epm-release_upgrade
View file @
b38de5e8
...
@@ -20,6 +20,50 @@
...
@@ -20,6 +20,50 @@
load_helper epm-query
load_helper epm-query
load_helper epm-repofix
load_helper epm-repofix
assure_safe_run
()
{
if
[
"
$TERM
"
=
"linux"
]
;
then
echo
"You have the best choise to run the '# epm release-upgrade' from text console."
return
fi
if
[
"
$TERM
"
!=
"screen"
]
;
then
if
[
-n
"
$force
"
]
;
then
echo
"You force me running not under screen (TERM=
$TERM
now)! You can lost your system!"
return
else
warning
"It is very dangerous to upgrade to next release from a GUI (your TERM=
$TERM
)."
warning
"It is recommended install 'screen' and run upgrade via screen: '# screen epm release-upgrade'"
fatal
"or run me with --force if you understand the risk."
fi
fi
# run under screen, check if systemd will not kill our processes
local
res
if
!
is_active_systemd systemd
;
then
return
fi
res
=
"
$(
busctl get-property org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager KillUserProcesses
)
"
if
[
"
$res
"
=
"b false"
]
;
then
echo
"Good news: systemd-logind will not kill your screen processes (KillUserProcesses=false)"
return
else
if
[
-n
"
$force
"
]
;
then
warning
"You force runnning even if systemd-logind kills screen on disconnect"
else
docmd epm
install
systemd-settings-disable-kill-user-processes
||
fatal
"Can't install the package above. Fix it or run with --force."
docmd serv systemd-logind restart
||
fatal
"Can't restart systemd-logind service. Fix it or run with --force."
fatal
"Now you need relogin to the system. In this session your screen still will be killed."
fi
fi
# check too: KillExcludeUsers
# can continue
return
0
}
SAVELISTDIR
=
/tmp/eepm-release_upgrade
SAVELISTDIR
=
/tmp/eepm-release_upgrade
__save_alt_repo_lists
()
__save_alt_repo_lists
()
{
{
...
@@ -441,6 +485,7 @@ __switch_alt_to_distro()
...
@@ -441,6 +485,7 @@ __switch_alt_to_distro()
epm_release_upgrade
()
epm_release_upgrade
()
{
{
assure_root
assure_root
assure_safe_run
info
"Starting upgrade/switch whole system to other release"
info
"Starting upgrade/switch whole system to other release"
info
"Check also http://wiki.etersoft.ru/Admin/UpdateLinux"
info
"Check also http://wiki.etersoft.ru/Admin/UpdateLinux"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment