Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
29c1256ee1
|
|||
4002279a20
|
|||
62ff301c3c
|
|||
fc6f29c0e1
|
|||
db865eafe9
|
@ -45,6 +45,11 @@ do_depclean=yes
|
||||
# do eix-sync on Gentoo
|
||||
do_reposync=yes
|
||||
|
||||
# do live-rebuild, go-rebuild, rust-rebuild, perl-cleaner etc. on Gentoo
|
||||
# set to no if using binary packages that are bumped when needed.
|
||||
# Leave as yes on package builders and if not using binary packages.
|
||||
do_rebuilds=yes
|
||||
|
||||
# to only write to stderr when something unexpected happens or manual action is required
|
||||
# set stderr_loglevel to warning
|
||||
stderr_loglevel=debug
|
||||
|
@ -261,6 +261,9 @@ def pkg_upgrade():
|
||||
if line.startswith(' * '):
|
||||
log.warning(line)
|
||||
|
||||
## rebuild as needed
|
||||
do_rebuild = conf.getboolean('default', 'do_rebuilds', fallback=True)
|
||||
if do_rebuild:
|
||||
# from here on we shouldn't need to rebuild the upgraded packages again
|
||||
exclude_list = ' --exclude '.join(rebuild_packages.keys()).split()
|
||||
|
||||
@ -367,7 +370,7 @@ def pkg_upgrade():
|
||||
log.warning(line)
|
||||
|
||||
|
||||
# Depclean
|
||||
## Depclean
|
||||
if conf.getboolean('default', 'do_depclean', fallback=False):
|
||||
cmd = [ EMERGE_PATH, '--color', 'n', '-q', '--depclean' ]
|
||||
ret, out, err = sau.helpers.exec_cmd(cmd, timeout=3600)
|
||||
@ -385,8 +388,8 @@ def pkg_upgrade():
|
||||
log.warning(line)
|
||||
|
||||
|
||||
# Preserved rebuild
|
||||
cmd = [ EMERGE_PATH, '--color', 'n', '-q', '@preserved-rebuild' ]
|
||||
## Preserved rebuild
|
||||
cmd = [ EMERGE_PATH, '--color', 'n', '--usepkg-exclude', '*/*', '-q', '@preserved-rebuild' ]
|
||||
ret, out, err = sau.helpers.exec_cmd(cmd, timeout=72000)
|
||||
|
||||
if ret != 0 or err:
|
||||
|
@ -10,7 +10,7 @@ import sau.errors
|
||||
import sau.helpers
|
||||
import sau.platforms
|
||||
|
||||
proc_fd_map_re = re.compile(r'^.*(/[^\(]*) \(deleted\)$')
|
||||
proc_fd_map_re = re.compile(r'^.*(/(?:usr|lib|opt|etc|s?bin)[^\(]*) \(deleted\)$')
|
||||
|
||||
def _warn(policy, msg):
|
||||
log = logging.getLogger(sau.LOGNAME)
|
||||
@ -28,7 +28,8 @@ def get_deleted_open_files(proc):
|
||||
for line in f:
|
||||
match = re.match(proc_fd_map_re, line)
|
||||
if match:
|
||||
files.add(match.group(1))
|
||||
fname = match.group(1)
|
||||
files.add(fname)
|
||||
return files
|
||||
|
||||
# on FreeBSD psutils open_files() helpfully returns a null path if a file
|
||||
@ -116,7 +117,6 @@ def restart_services():
|
||||
retest_procs.add(proc)
|
||||
|
||||
recommend_restart = False
|
||||
processes = {}
|
||||
services = {}
|
||||
for proc in service_procs:
|
||||
if not proc:
|
||||
@ -141,15 +141,17 @@ def restart_services():
|
||||
sau.helpers.exec_cmd([ '/usr/bin/systemctl', 'daemon-reexec' ])
|
||||
continue
|
||||
elif service_name == '@ignore':
|
||||
log.info(f"Process {proc} ignored by configuration")
|
||||
retest_procs.discard(proc)
|
||||
continue
|
||||
|
||||
services[proc_name] = service_name
|
||||
processes[service_name] = [proc]
|
||||
|
||||
for service in set([x for x in services.values() if x]):
|
||||
policy = _get_service_restart_policy(service)
|
||||
if policy == 'ignore':
|
||||
log.info('Service "{}" ignored by configuration'.format(service))
|
||||
[retest_procs.discard(x) for x,y in services.items() if y == service]
|
||||
continue
|
||||
elif policy == 'warn':
|
||||
log.warning('Service "{}" has open deleted files and should be restarted'.format(service))
|
||||
|
4
setup.py
4
setup.py
@ -1,11 +1,11 @@
|
||||
#!/usr/bin/env python3.7
|
||||
#!/usr/bin/env python3
|
||||
from os import environ
|
||||
|
||||
from setuptools import setup, find_packages
|
||||
|
||||
setup(
|
||||
name='sau',
|
||||
version='1.3.4',
|
||||
version='1.4.1',
|
||||
description='Tool for auto-updating OS and packages',
|
||||
author='Feffe',
|
||||
author_email='feffe@fulh.ax',
|
||||
|
Reference in New Issue
Block a user