003 File Manager
Current Path:
/usr/src/libexec/rc/rc.d
usr
/
src
/
libexec
/
rc
/
rc.d
/
📁
..
📄
DAEMON
(178 B)
📄
FILESYSTEMS
(351 B)
📄
LOGIN
(342 B)
📄
Makefile
(4.08 KB)
📄
NETWORKING
(299 B)
📄
SERVERS
(209 B)
📄
accounting
(1.64 KB)
📄
addswap
(319 B)
📄
adjkerntz
(219 B)
📄
apm
(595 B)
📄
apmd
(608 B)
📄
archdep
(298 B)
📄
auditd
(587 B)
📄
auditdistd
(384 B)
📄
automount
(414 B)
📄
automountd
(369 B)
📄
autounmountd
(318 B)
📄
bgfsck
(968 B)
📄
blacklistd
(1.66 KB)
📄
bluetooth
(8.91 KB)
📄
bootparams
(303 B)
📄
bridge
(2.22 KB)
📄
bsnmpd
(347 B)
📄
bthidd
(928 B)
📄
ccd
(300 B)
📄
cfumass
(2.93 KB)
📄
cleanvar
(908 B)
📄
cleartmp
(1.8 KB)
📄
cron
(368 B)
📄
ctld
(376 B)
📄
ddb
(538 B)
📄
defaultroute
(1.43 KB)
📄
devd
(684 B)
📄
devfs
(1.36 KB)
📄
devmatch
(2.29 KB)
📄
dhclient
(1.37 KB)
📄
dmesg
(412 B)
📄
dumpon
(1.3 KB)
📄
fsck
(1.61 KB)
📄
ftp-proxy
(2.3 KB)
📄
ftpd
(376 B)
📄
gbde
(2.1 KB)
📄
geli
(3.5 KB)
📄
geli2
(1.88 KB)
📄
gptboot
(2.46 KB)
📄
growfs
(3.1 KB)
📄
gssd
(228 B)
📄
hastd
(505 B)
📄
hcsecd
(463 B)
📄
hostapd
(621 B)
📄
hostid
(3.65 KB)
📄
hostid_save
(586 B)
📄
hostname
(2.56 KB)
📄
inetd
(344 B)
📄
iovctl
(445 B)
📄
ip6addrctl
(2.52 KB)
📄
ipfilter
(2.03 KB)
📄
ipfs
(1.05 KB)
📄
ipfw
(3.04 KB)
📄
ipfw_netflow
(1.92 KB)
📄
ipmon
(723 B)
📄
ipnat
(506 B)
📄
ippool
(579 B)
📄
ipropd_master
(703 B)
📄
ipropd_slave
(509 B)
📄
ipsec
(1.11 KB)
📄
iscsictl
(335 B)
📄
iscsid
(309 B)
📄
jail
(13.88 KB)
📄
kadmind
(518 B)
📄
kdc
(469 B)
📄
keyserv
(411 B)
📄
kfd
(297 B)
📄
kld
(1.66 KB)
📄
kldxref
(709 B)
📄
kpasswdd
(498 B)
📄
ldconfig
(1.93 KB)
📄
linux
(1.47 KB)
📄
local
(529 B)
📄
local_unbound
(2.71 KB)
📄
localpkg
(1.35 KB)
📄
lockd
(625 B)
📄
lpd
(416 B)
📄
mdconfig
(4.98 KB)
📄
mdconfig2
(5.86 KB)
📄
mixer
(2.4 KB)
📄
motd
(1.28 KB)
📄
mountcritlocal
(1.2 KB)
📄
mountcritremote
(1.82 KB)
📄
mountd
(1.48 KB)
📄
mountlate
(723 B)
📄
moused
(1.6 KB)
📄
msgs
(396 B)
📄
natd
(762 B)
📄
netif
(5.72 KB)
📄
netoptions
(2.71 KB)
📄
netwait
(3 KB)
📄
newsyslog
(459 B)
📄
nfscbd
(284 B)
📄
nfsclient
(1.03 KB)
📄
nfsd
(1.19 KB)
📄
nfsuserd
(514 B)
📄
nisdomain
(1.76 KB)
📄
nscd
(1.04 KB)
📄
ntpd
(7.11 KB)
📄
ntpdate
(696 B)
📄
opensm
(444 B)
📄
os-release
(952 B)
📄
othermta
(286 B)
📄
pf
(1.17 KB)
📄
pflog
(2.24 KB)
📄
pfsync
(787 B)
📄
power_profile
(2.06 KB)
📄
powerd
(429 B)
📄
ppp
(2.28 KB)
📄
pppoed
(585 B)
📄
pwcheck
(428 B)
📄
quota
(576 B)
📄
random
(2.86 KB)
📄
rarpd
(339 B)
📄
rctl
(469 B)
📄
resolv
(2.02 KB)
📄
rfcomm_pppd_server
(2.31 KB)
📄
root
(724 B)
📄
route6d
(369 B)
📄
routed
(409 B)
📄
routing
(7.91 KB)
📄
rpcbind
(331 B)
📄
rtadvd
(1.62 KB)
📄
rtsold
(430 B)
📄
rwho
(247 B)
📄
savecore
(1.27 KB)
📄
sdpd
(465 B)
📄
securelevel
(519 B)
📄
sendmail
(6.42 KB)
📄
serial
(4.98 KB)
📄
sppp
(835 B)
📄
sshd
(1.41 KB)
📄
statd
(587 B)
📄
static_arp
(2.12 KB)
📄
static_ndp
(2.09 KB)
📄
stf
(1.83 KB)
📄
swap
(224 B)
📄
swaplate
(258 B)
📄
syscons
(7.75 KB)
📄
sysctl
(592 B)
📄
syslogd
(1.48 KB)
📄
sysvipc
(323 B)
📄
tmp
(2.19 KB)
📄
ubthidhci
(762 B)
📄
ugidfw
(992 B)
📄
utx
(266 B)
📄
var
(3.16 KB)
📄
virecover
(1.55 KB)
📄
watchdogd
(2.65 KB)
📄
wpa_supplicant
(817 B)
📄
ypbind
(504 B)
📄
ypldap
(358 B)
📄
yppasswdd
(584 B)
📄
ypserv
(584 B)
📄
ypset
(544 B)
📄
ypupdated
(496 B)
📄
ypxfrd
(540 B)
📄
zfs
(872 B)
📄
zfsbe
(1.65 KB)
📄
zfsd
(209 B)
📄
zpool
(457 B)
📄
zvol
(736 B)
Editing: ntpd
#!/bin/sh # # $FreeBSD$ # # PROVIDE: ntpd # REQUIRE: DAEMON ntpdate FILESYSTEMS devfs # BEFORE: LOGIN # KEYWORD: nojail shutdown . /etc/rc.subr name="ntpd" desc="Network Time Protocol daemon" rcvar="ntpd_enable" command="/usr/sbin/${name}" extra_commands="fetch needfetch" fetch_cmd="ntpd_fetch_leapfile" needfetch_cmd="ntpd_needfetch_leapfile" start_precmd="ntpd_precmd" _ntp_tmp_leapfile="/var/run/ntpd.leap-seconds.list" _ntp_default_dir="/var/db/ntp" _ntp_default_driftfile="${_ntp_default_dir}/ntpd.drift" _ntp_old_driftfile="/var/db/ntpd.drift" pidfile="${_ntp_default_dir}/${name}.pid" load_rc_config $name leapfile_is_disabled() { # Return true (0) if automatic leapfile handling is disabled. case "$ntp_db_leapfile" in [Nn][Oo] | [Nn][Oo][Nn][Ee] ) return 0;; * ) return 1;; esac } can_run_nonroot() { # If the admin set what uid to use, we don't change it. if [ -n "${ntpd_user}" ]; then return 1 fi # If the admin set any command line options involving files, we # may not be able to access them as user ntpd. case "${rc_flags}" in *-f* | *--driftfile* | *-i* | *--jaildir* | \ *-k* | *--keyfile* | *-l* | *--logfile* | \ *-p* | *--pidfile* | *-s* | *--statsdir* ) return 1;; esac # If the admin set any options in ntp.conf involving files, # we may not be able to access them as user ntpd. local fileopts="^[ \t]*crypto|^[ \t]*driftfile|^[ \t]*key|^[ \t]*logfile|^[ \t]*statsdir" grep -E -q "${fileopts}" "${ntpd_config}" && return 1 # Try to set up the the MAC ntpd policy so ntpd can run with reduced # privileges. Detect whether MAC is compiled into the kernel, load # the policy module if not already present, then check whether the # policy has been disabled via tunable or sysctl. [ -n "$(sysctl -qn security.mac.version)" ] || return 1 sysctl -qn security.mac.ntpd >/dev/null || kldload -qn mac_ntpd || return 1 [ "$(sysctl -qn security.mac.ntpd.enabled)" == "1" ] || return 1 # On older existing systems, the ntp dir may by owned by root, change # it to ntpd to give the daemon create/write access to the driftfile. if [ "$(stat -f %u ${_ntp_default_dir})" = "0" ]; then chown ntpd:ntpd "${_ntp_default_dir}" || return 1 chmod 0755 "${_ntp_default_dir}" || return 1 logger -s -t "rc.d/ntpd" -p daemon.notice \ "${_ntp_default_dir} updated to owner ntpd:ntpd, mode 0755" fi # If the driftfile exists in the standard location for older existing # systems, move it into the ntp dir and fix the ownership if we can. if [ -f "${_ntp_old_driftfile}" ] && [ ! -L "${_ntp_old_driftfile}" ]; then mv "${_ntp_old_driftfile}" "${_ntp_default_driftfile}" && chown ntpd:ntpd "${_ntp_default_driftfile}" || return 1 logger -s -t "rc.d/ntpd" -p daemon.notice \ "${_ntp_default_driftfile} updated to owner ntpd:ntpd" logger -s -t "rc.d/ntpd" -p daemon.notice \ "${_ntp_old_driftfile} moved to ${_ntp_default_driftfile}" fi } ntpd_precmd() { local driftopt # If we can run as a non-root user, switch uid to ntpd and use the # new default location for the driftfile inside the ntpd-owned dir. # Otherwise, figure out what to do about the driftfile option. If set # by the admin, we don't add the option. If the file exists in the old # default location we use that, else we use the new default location. if can_run_nonroot; then _user="ntpd" driftopt="-f ${_ntp_default_driftfile}" elif grep -q "^[ \t]*driftfile" "${ntpd_config}" || [ -n "${rc_flags}" ] && ( [ -z "${rc_flags##*-f*}" ] || [ -z "${rc_flags##*--driftfile*}" ] ); then driftopt="" # admin set the option, we don't need to add it. elif [ -f "${_ntp_old_driftfile}" ]; then driftopt="-f ${_ntp_old_driftfile}" else driftopt="-f ${_ntp_default_driftfile}" fi # Set command_args based on the various config vars. command_args="-p ${pidfile} -c ${ntpd_config} ${driftopt}" if checkyesno ntpd_sync_on_start; then command_args="${command_args} -g" fi # Make sure the leapfile is ready to use, unless leapfile # handling is disabled. if leapfile_is_disabled; then return fi ntpd_init_leapfile if [ ! -f "${ntp_db_leapfile}" ]; then ntpd_fetch_leapfile fi } current_ntp_ts() { # Seconds between 1900-01-01 and 1970-01-01 # echo $(((70*365+17)*86400)) ntp_to_unix=2208988800 echo $(($(date -u +%s)+$ntp_to_unix)) } get_ntp_leapfile_ver() { # Leapfile update date (version number). expr "$(awk '$1 == "#$" { print $2 }' "$1" 2>/dev/null)" : \ '^\([1-9][0-9]*\)$' \| 0 } get_ntp_leapfile_expiry() { # Leapfile expiry date. expr "$(awk '$1 == "#@" { print $2 }' "$1" 2>/dev/null)" : \ '^\([1-9][0-9]*\)$' \| 0 } ntpd_init_leapfile() { if leapfile_is_disabled; then return fi # Refresh working leapfile with an invalid hash due to # FreeBSD id header. Ntpd will ignore leapfiles with a # mismatch hash. The file must be the virgin file from # the source. if [ ! -f $ntp_db_leapfile ]; then cp -p $ntp_src_leapfile $ntp_db_leapfile fi } ntpd_needfetch_leapfile() { local rc verbose if leapfile_is_disabled; then # Return code 1: ntp leapfile fetch not needed return 1 fi if checkyesno ntp_leapfile_fetch_verbose; then verbose=echo else verbose=: fi ntp_ver_no_src=$(get_ntp_leapfile_ver $ntp_src_leapfile) ntp_expiry_src=$(get_ntp_leapfile_expiry $ntp_src_leapfile) ntp_ver_no_db=$(get_ntp_leapfile_ver $ntp_db_leapfile) ntp_expiry_db=$(get_ntp_leapfile_expiry $ntp_db_leapfile) $verbose ntp_src_leapfile version is $ntp_ver_no_src expires $ntp_expiry_src $verbose ntp_db_leapfile version is $ntp_ver_no_db expires $ntp_expiry_db if [ "$ntp_ver_no_src" -gt "$ntp_ver_no_db" -o \ "$ntp_ver_no_src" -eq "$ntp_ver_no_db" -a \ "$ntp_expiry_src" -gt "$ntp_expiry_db" ]; then $verbose replacing $ntp_db_leapfile with $ntp_src_leapfile cp -p $ntp_src_leapfile $ntp_db_leapfile ntp_ver_no_db=$ntp_ver_no_src else $verbose not replacing $ntp_db_leapfile with $ntp_src_leapfile fi ntp_leapfile_expiry_seconds=$((ntp_leapfile_expiry_days*86400)) ntp_leap_expiry=$(get_ntp_leapfile_expiry $ntp_db_leapfile) ntp_leap_fetch_date=$((ntp_leap_expiry-ntp_leapfile_expiry_seconds)) if [ $(current_ntp_ts) -ge $ntp_leap_fetch_date ]; then $verbose Within ntp leapfile expiry limit, initiating fetch # Return code 0: ntp leapfile fetch needed return 0 fi # Return code 1: ntp leapfile fetch not needed return 1 } ntpd_fetch_leapfile() { if leapfile_is_disabled; then return fi if checkyesno ntp_leapfile_fetch_verbose; then verbose=echo else verbose=: fi if ntpd_needfetch_leapfile ; then for url in $ntp_leapfile_sources ; do $verbose fetching $url fetch $ntp_leapfile_fetch_opts -o $_ntp_tmp_leapfile $url && break done ntp_ver_no_tmp=$(get_ntp_leapfile_ver $_ntp_tmp_leapfile) ntp_expiry_tmp=$(get_ntp_leapfile_expiry $_ntp_tmp_leapfile) if [ "$ntp_expiry_tmp" -gt "$ntp_expiry_db" -o \ "$ntp_expiry_tmp" -eq "$ntp_expiry_db" -a \ "$ntp_ver_no_tmp" -gt "$ntp_ver_no_db" ]; then $verbose using $url as $ntp_db_leapfile mv -f $_ntp_tmp_leapfile $ntp_db_leapfile || $verbose "warning: cannot replace $ntp_db_leapfile (read-only fs?)" else $verbose using existing $ntp_db_leapfile fi fi } run_rc_command "$1"
Upload File
Create Folder