HEX
Server: Apache/2
System: Linux jingle.dotvndns.vn 2.6.32-754.17.1.el6.x86_64 #1 SMP Tue Jul 2 12:42:48 UTC 2019 x86_64
User: chuahuehuong (1863)
PHP: 7.3.16
Disabled: apache_note,apache_setenv,proc_get_status,exec,passthru,proc_nice,proc_terminate,shell_exec,system,ini_restore,syslog,define_syslog_variables,symlink,link,error_log,leak,dbmopen,closelog,stream_socket_server,execl,escapeshellcmd,ini_alter,dl,show_source,posix_getpwuid,posix_geteuid,posix_getegid,posix_getgrgid,open_basedir,safe_mode_include_dir,pcntl_exec,pcntl_fork,pclose,virtual,openlog,popen,escapeshellarg,eval,calo,posix_getpwuid,symlinks,symlink,getpwuid,mail
Upload Files
File: //etc/rc.d/init.d/sandbox
#!/bin/bash
## BEGIN INIT INFO
# Provides: sandbox
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 3 4 6
# Required-Start:
#              
## END INIT INFO
# sandbox:        Set up / mountpoint to be shared, /var/tmp, /tmp, /home/sandbox unshared
#
# chkconfig: 345 1 99
#
# description: sandbox, xguest and other apps that want to use pam_namespace \
#              require this script be run at boot.  This service script does \
#              not actually run any service but sets up: \
#              /var/tmp, /tmp and home directories to be used by these tools.\
#              If you do not use sandbox, xguest or pam_namespace you can turn \
#              this service off.\
#

# Source function library.
. /etc/init.d/functions

HOMEDIRS="/home"

. /etc/sysconfig/sandbox

LOCKFILE=/var/lock/subsys/sandbox

base=${0##*/}

start() {
	echo -n "Starting sandbox"

	[ -f "$LOCKFILE" ] && return 1

	touch $LOCKFILE
	mount --make-rshared / || return $? 
	mount --rbind /tmp /tmp || return $?
	mount --rbind /var/tmp /var/tmp || return $?
	mount --make-private /tmp || return $?
	mount --make-private /var/tmp || return $?
	for h in $HOMEDIRS; do
	    mount --rbind $h $h || return $?
	    mount --make-private $h || return $?
	done

	return 0
}

stop() {
	echo -n "Stopping sandbox"

	[ -f "$LOCKFILE" ] || return 1
}

status() {
	if [ -f "$LOCKFILE" ]; then 
	    echo "$base is running"
	else
	    echo "$base is stopped"
	fi
	exit 0
}

case "$1" in
    restart)
	start && success || failure
	;;

    start)
	start && success || failure
	echo
	;;

    stop)
	stop && success || failure
	echo
	;;

    status)
	status
	;;

    *)
	echo $"Usage: $0 {start|stop|status|restart}"
	exit 3
	;;
esac