#! /bin/sh ### BEGIN INIT INFO # Provides: checkroot-bootclean # Required-Start: checkroot # Required-Stop: # Default-Start: S # Default-Stop: # X-Start-Before: bootmisc # Short-Description: bootclean after checkroot. # Description: Clean temporary filesystems after # the root filesystem has been mounted. # At this point, directories which may be # masked by future mounts may be cleaned. ### END INIT INFO source /lib/lsb/init-functions source /lib/init/bootclean.sh matchstr $1 { start|"" { # Clean /tmp, /run and /run/lock. Remove the .clean files to # force initial cleaning. This is intended to allow cleaning # of directories masked by mounts while the system was # previously running, which would otherwise prevent them being # cleaned. rm -f /tmp/.clean /run/.clean /run/lock/.clean clean_all exit $Status } restart|reload|force-reload { echo "Error: argument '$1' not supported" > !2 exit 3 } stop|status { # No-op } * { echo "Usage: checkroot-bootclean.sh [start|stop]" > !2 exit 3 } } : (CommandList children: [ (C {(.)} {(/lib/lsb/init-functions)}) (C {(.)} {(/lib/init/bootclean.sh)}) (Case to_match: {(DQ ($ VSub_Number "$1"))} arms: [ (case_arm pat_list: [{(start)} {(DQ )}] action: [ (C {(rm)} {(-f)} {(/tmp/.clean)} {(/run/.clean)} {(/run/lock/.clean)}) (C {(clean_all)}) (C {(exit)} {($ VSub_QMark "$?")}) ] spids: [61 65 108 -1] ) (case_arm pat_list: [{(restart)} {(reload)} {(force-reload)}] action: [ (SimpleCommand words: [{(echo)} {(DQ ("Error: argument '") ($ VSub_Number "$1") ("' not supported"))}] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[127])] ) (C {(exit)} {(3)}) ] spids: [111 116 136 -1] ) (case_arm pat_list:[{(stop)}{(status)}] spids:[139142149-1]) (case_arm pat_list: [{(Lit_Other "*")}] action: [ (SimpleCommand words: [{(echo)} {(DQ ("Usage: checkroot-bootclean.sh [start|stop]"))}] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[162])] ) (C {(exit)} {(3)}) ] spids: [152 153 171 -1] ) ] spids: [52 58 173] ) (C {(Lit_Other ":")}) ] )