Server IP : 85.214.239.14 / Your IP : 3.144.48.9 Web Server : Apache/2.4.62 (Debian) System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.18 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /proc/2/task/2/cwd/etc/rc0.d/ |
Upload File : |
#! /bin/sh ### BEGIN INIT INFO # Provides: umountfs # Required-Start: # Required-Stop: umountroot # Default-Start: # Default-Stop: 0 6 # Short-Description: Turn off swap and unmount all local file systems. # Description: ### END INIT INFO PATH=/usr/sbin:/usr/bin:/sbin:/bin . /lib/init/vars.sh . /lib/lsb/init-functions umask 022 do_stop () { PROTECTED_MOUNTS="$(sed -n ':a;/^[^ ]* \/ /!{H;n;ba};{H;s/.*//;x;s/\n//;p}' /proc/mounts)" WEAK_MTPTS="" # be gentle, don't use force REG_MTPTS="" TMPFS_MTPTS="" while read -r DEV MTPT FSTYPE REST do echo "$PROTECTED_MOUNTS" | grep -qsF "$DEV $MTPT " && continue case "$MTPT" in /|/usr|/proc|/dev|/.dev|/dev/pts|/dev/shm|/dev/.static/dev|/proc/*|/sys|/sys/*|/run|/run/lock|/run/shm|/run/rpc_pipefs|/dev/vcs) continue ;; esac case "$FSTYPE" in proc|procfs|linprocfs|sysfs|securityfs|usbfs|usbdevfs|devpts) continue ;; tmpfs) TMPFS_MTPTS="$MTPT $TMPFS_MTPTS" ;; *) if echo "$PROTECTED_MOUNTS" | grep -qs "^$DEV "; then WEAK_MTPTS="$MTPT $WEAK_MTPTS" else REG_MTPTS="$MTPT $REG_MTPTS" fi ;; esac done < /proc/mounts # # Make sure tmpfs file systems are umounted before turning off # swap, to avoid running out of memory if the tmpfs filesystems # use a lot of space. # if [ "$TMPFS_MTPTS" ] then if [ "$VERBOSE" = no ] then log_action_begin_msg "Unmounting temporary filesystems" fstab-decode umount $TMPFS_MTPTS log_action_end_msg $? else log_daemon_msg "Will now unmount temporary filesystems" fstab-decode umount -v $TMPFS_MTPTS log_end_msg $? fi fi # # Deactivate swap # if [ "$VERBOSE" = no ] then log_action_begin_msg "Deactivating swap" swapoff -a >/dev/null log_action_end_msg $? else log_daemon_msg "Will now deactivate swap" swapoff -a -v log_end_msg $? fi # # Unmount local filesystems # if [ "$WEAK_MTPTS" ]; then # Do not use -f umount option for WEAK_MTPTS if [ "$VERBOSE" = no ] then log_action_begin_msg "Unmounting weak filesystems" fstab-decode umount -r -d $WEAK_MTPTS log_action_end_msg $? else log_daemon_msg "Will now unmount weak filesystems" fstab-decode umount -v -r -d $WEAK_MTPTS log_end_msg $? fi fi if [ "$REG_MTPTS" ] then if [ "$VERBOSE" = no ] then log_action_begin_msg "Unmounting local filesystems" fstab-decode umount -f -r -d $REG_MTPTS log_action_end_msg $? else log_daemon_msg "Will now unmount local filesystems" fstab-decode umount -f -v -r -d $REG_MTPTS log_end_msg $? fi fi } case "$1" in start|status) # No-op ;; restart|reload|force-reload) echo "Error: argument '$1' not supported" >&2 exit 3 ;; stop) do_stop ;; *) echo "Usage: $0 start|stop" >&2 exit 3 ;; esac :