Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:12.3
zfs-fuse
zfs-fuse.init
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File zfs-fuse.init of Package zfs-fuse
#!/bin/bash # ### BEGIN INIT INFO # Provides: zfs-fuse # Required-Start: $remote_fs # Required-Stop: $remote_fs # Default-Start: S 1 2 3 5 # Default-Stop: 0 6 # PIDFile: /var/run/zfs/zfs-fuse.pid # Short-Description: ZFS FUSE # Description: Start/stops the ZFS FUSE daemon and mounts/unmounts # existing ZFS filesystems ### END INIT INFO ZFS_FUSE=/usr/sbin/zfs-fuse ZFS_FUSE_CONFIG=/etc/sysconfig/zfs-fuse ZFS_NICE_LEVEL=0 ZFS_ALLOW_RELOAD=no PIDFILE=/var/run/zfs/zfs-fuse.pid PATH=/sbin:/bin:/usr/sbin:/usr/bin LC_ALL=C export PATH LC_ALL ulimit -v unlimited ulimit -c 512000 ulimit -l unlimited ulimit -s unlimited parse_boolean () { case $1 in [yY][eE][sS]|[tT][rR][uU][eE]) return 0 ;; [nN][oO]|[fF][aA][lL][sS][eE]) return 1 ;; *) return 2 ;; esac } function start { # start daemon startproc -n ${ZFS_NICE_LEVEL} -w -p "${PIDFILE}" \ ${ZFS_FUSE} --pidfile "${PIDFILE}" >/dev/null 2>&1 || return $? read -r zfs_fuse_pid < "${PIDFILE}" [[ ${zfs_fuse_pid} != "" ]] || return 1 # protect against OOM-killer printf -- "-17\n" > "/proc/${zfs_fuse_pid}/oom_adj" # mount all filesystems zfs mount -a return 0 } function stop { # check if running checkproc -k -p "${PIDFILE}" ${ZFS_FUSE} || return 0 read -r zfs_fuse_pid < "${PIDFILE}" [[ ${zfs_fuse_pid} != "" ]] || return 1 # try to unmount all filesystems if ! zfs umount -a; then # when shutting down forcibly unmount, otherwise return an error if ((RUNLEVEL == 0)) || ((RUNLEVEL == 6)); then zfs umount -a -f else return 1 fi fi # terminate zfs-fuse daemon killproc -p "${PIDFILE}" ${ZFS_FUSE} for ((i=0; i<10; i++)); do kill -0 "${zfs_fuse_pid}" >/dev/null 2>&1 || return 0 sleep 1 done return 3 } function restart { if ! parse_boolean "${ZFS_ALLOW_RELOAD}"; then return 1 fi stop || return $? start || return $? } function status { checkproc -k -p "${PIDFILE}" ${ZFS_FUSE} } if [[ ! -x ${ZFS_FUSE} ]]; then printf "zfs-fuse is not installed\n" [[ $1 == stop ]] && exit 0 || exit 5 fi if [[ ! -r ${ZFS_FUSE_CONFIG} ]]; then printf "zfs fuse is not configured, %s does not exist\n" \ "${ZFS_FUSE_CONFIG}" [[ $1 == "stop" ]] && exit 0 || exit 6 fi . "${ZFS_FUSE_CONFIG}" . /etc/rc.status rc_reset case $1 in start) printf "Starting zfs-fuse daemon" start rc_status -v ;; stop) printf "Shutting down zfs-fuse daemon" stop rc_status -v ;; try-restart) if status; then printf "Restarting zfs-fuse daemon" restart rc_status -v else exit 0 fi ;; restart|force-reload) printf "Restarting zfs-fuse daemon" restart rc_status -v ;; status) printf "Checking for zfs-fuse daemon" status rc_status -v ;; *) printf "Usage: %s {start|stop|status|try-restart|restart|force-reload}\n" "${0##*/}" exit 2 ;; esac rc_exit
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor