Server IP : 127.0.0.2 / Your IP : 3.145.0.146 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 : /lib/open-iscsi/ |
Upload File : |
#!/bin/sh -e # suppress configuration of network interface used # by iSCSI root device # # If the root filesystem is on iSCSI, then we must take care to avoid # changing the state of its network interface. To this end, the initramfs # leaves a note for us which interface was used, and we mangle # /run/network/ifstate manually to stop it being brought up or down # automatically. This is a slight layering violation, but, unfortunately, # ifupdown appears to have no way to do this without also running # /etc/network/*.d/ scripts. assert_interface() { # udev sets INTERFACE to the name of the currently-processed nic. [ -n "$INTERFACE" ] && return 0 echo "environment variable INTERFACE not set." 1>&2; return 1 } start() { CR=" " assert_interface || return ifile=/run/initramfs/open-iscsi.interface [ -f "$ifile" ] && read iface < "$ifile" || return 0 [ "$INTERFACE" = "$iface" ] || return if ! grep -qs "^$iface=" /run/network/ifstate; then mkdir -p /run/network echo "$iface=$iface" >>/run/network/ifstate if [ -x /etc/network/if-up.d/upstart ]; then IFACE=$iface LOGICAL=$iface ADDRFAM=inet METHOD=manual /etc/network/if-up.d/upstart fi if [ -f /run/net-$iface.conf ]; then conf=/run/net-$iface.conf elif [ -f /run/net6-$iface.conf ]; then conf=/run/net6-$iface.conf else conf="" fi if command -v resolvconf >/dev/null && [ -n "$conf" ]; then . "$conf" R="" [ -n "$DOMAINSEARCH" ] && R="$R${CR}search $DOMAINSEARCH" [ -n "$IPV6DOMAINSEARCH" ] && R="$R${CR}search $IPV6DOMAINSEARCH" for ns in "$IPV4DNS0" "$IPV4DNS1" "$IPV6DNS0" "$IPV6DNS1"; do [ -n "$ns" -a "$ns" != "0.0.0.0" ] && R="$R${CR}nameserver $ns" done if [ -n "$R" ]; then # create the dir in case resolvconf did not start yet mkdir -p /run/resolvconf/interface resolvconf -a $iface.iscsi-network <<EOF ${R#${CR}} EOF fi fi fi } stop() { assert_interface || return ifile=/run/initramfs/open-iscsi.interface [ -f "$ifile" ] && read iface < "$ifile" || return 0 [ "$INTERFACE" = "$iface" ] || return if grep -qs "^$iface=" /run/network/ifstate; then grep -v "^$iface=" /run/network/ifstate >/run/network/.ifstate.tmp || true mv /run/network/.ifstate.tmp /run/network/ifstate if command -v resolvconf >/dev/null; then resolvconf -d $iface.iscsi-network fi fi } case "$1" in start) start ;; stop) stop ;; *) echo "ERROR: must be called with 'start' or 'stop'" >&2; exit 1 ;; esac