mirror of
https://aur.archlinux.org/autofs-openrc.git
synced 2024-12-26 19:33:26 +00:00
commit
935d4120f5
18
.SRCINFO
Normal file
18
.SRCINFO
Normal file
@ -0,0 +1,18 @@
|
||||
pkgbase = autofs-openrc
|
||||
pkgdesc = OpenRC autofs init script
|
||||
pkgver = 20210506
|
||||
pkgrel = 2
|
||||
url = https://code.obermui.de/6543/autofs-openrc
|
||||
arch = any
|
||||
license = GPL2
|
||||
depends = openrc
|
||||
depends = autofs
|
||||
provides = init-autofs
|
||||
conflicts = init-autofs
|
||||
source = autofs.confd
|
||||
source = autofs.initd
|
||||
sha256sums = d95fc4b88c02dafcd771e35f7422f4f03642687187a17613d3f2b0fb48caaad4
|
||||
sha256sums = 517faf155ff348df8df4437d6c5352538f0b686d22b646d816b9efe91e4eebd2
|
||||
|
||||
pkgname = autofs-openrc
|
||||
|
33
.gitignore
vendored
Normal file
33
.gitignore
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
# ---> ArchLinuxPackages
|
||||
*.tar
|
||||
*.tar.*
|
||||
*.jar
|
||||
*.exe
|
||||
*.msi
|
||||
*.zip
|
||||
*.tgz
|
||||
*.log
|
||||
*.log.*
|
||||
*.sig
|
||||
|
||||
pkg/
|
||||
src/
|
||||
|
||||
|
||||
# ---> Archives
|
||||
*.7z
|
||||
*.rar
|
||||
*.gz
|
||||
*.bzip
|
||||
*.bz2
|
||||
*.xz
|
||||
*.lzma
|
||||
*.cab
|
||||
|
||||
# ---> systemd
|
||||
*.service
|
||||
*.socket
|
||||
*.timer
|
||||
|
||||
# ---> snap
|
||||
*.snap
|
23
PKGBUILD
Normal file
23
PKGBUILD
Normal file
@ -0,0 +1,23 @@
|
||||
# Maintainer: 6543 <6543@obermui.de>
|
||||
# Contributor: artoo <artoo@artixlinux.org>
|
||||
# Contributor: Oscar Campos <damnwidget@artixlinux.org>
|
||||
|
||||
pkgname=autofs-openrc
|
||||
pkgver=20210506
|
||||
pkgrel=2
|
||||
pkgdesc="OpenRC autofs init script"
|
||||
arch=('any')
|
||||
url="https://code.obermui.de/6543/autofs-openrc"
|
||||
license=('GPL2')
|
||||
provides=('init-autofs')
|
||||
depends=('openrc' 'autofs')
|
||||
conflicts=('init-autofs')
|
||||
source=("autofs.confd"
|
||||
"autofs.initd")
|
||||
sha256sums=('d95fc4b88c02dafcd771e35f7422f4f03642687187a17613d3f2b0fb48caaad4'
|
||||
'517faf155ff348df8df4437d6c5352538f0b686d22b646d816b9efe91e4eebd2')
|
||||
|
||||
package() {
|
||||
install -Dm755 "${srcdir}/autofs.initd" "${pkgdir}/etc/init.d/autofs"
|
||||
install -Dm644 "${srcdir}/autofs.confd" "${pkgdir}/etc/conf.d/autofs"
|
||||
}
|
14
autofs.confd
Normal file
14
autofs.confd
Normal file
@ -0,0 +1,14 @@
|
||||
#
|
||||
# Init syatem options
|
||||
#
|
||||
# If the kernel supports using the autofs miscellanous device
|
||||
# and you wish to use it you must set this configuration option
|
||||
# to "yes" otherwise it will not be used.
|
||||
#
|
||||
USE_MISC_DEVICE="yes"
|
||||
#
|
||||
# Use OPTIONS to add automount(8) command line options that
|
||||
# will be used when the daemon is started.
|
||||
#
|
||||
#OPTIONS=""
|
||||
#
|
69
autofs.initd
Normal file
69
autofs.initd
Normal file
@ -0,0 +1,69 @@
|
||||
#!/usr/bin/openrc-run
|
||||
# Copyright 1999-2011 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
DAEMON=/usr/bin/automount
|
||||
PIDFILE=/run/autofs.pid
|
||||
DEVICE=autofs
|
||||
|
||||
depend() {
|
||||
need localmount
|
||||
use ypbind nfs slapd portmap net
|
||||
}
|
||||
|
||||
extra_started_commands="reload"
|
||||
|
||||
start() {
|
||||
ebegin "Starting automounter"
|
||||
|
||||
# Ensure autofs support is loaded
|
||||
grep -q autofs /proc/filesystems || modprobe -q autofs4
|
||||
if [ $? -ne 0 ]; then
|
||||
eend 1 "No autofs support available in kernel"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Check misc device
|
||||
if [ -n "${USE_MISC_DEVICE}" -a "${USE_MISC_DEVICE}" = "yes" ]; then
|
||||
sleep 1
|
||||
if [ -e "/proc/misc" ]; then
|
||||
MINOR=$(awk "/${DEVICE}/ {print \$1}" /proc/misc)
|
||||
if [ -n "${MINOR}" -a ! -c "/dev/${DEVICE}" ]; then
|
||||
mknod -m 0600 "/dev/${DEVICE}" c 10 ${MINOR}
|
||||
if [ $? -ne 0 ]; then
|
||||
eend 1 "Could not create '/dev/${DEVICE}'"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if [ -x /usr/bin/restorecon -a -c "/dev/${DEVICE}" ]; then
|
||||
/usr/bin/restorecon "/dev/${DEVICE}"
|
||||
if [ $? -ne 0 ]; then
|
||||
eend 1 "Failed to execute '/usr/bin/restorecon \"/dev/${DEVICE}\"'"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
else
|
||||
[ -c "/dev/${DEVICE}" ] && rm -rf "/dev/${DEVICE}"
|
||||
fi
|
||||
|
||||
start-stop-daemon --start --exec ${DAEMON} -- -p ${PIDFILE} ${OPTIONS}
|
||||
|
||||
eend $?
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping automounter"
|
||||
start-stop-daemon --stop --quiet -R TERM/45 -p ${PIDFILE}
|
||||
eend $?
|
||||
}
|
||||
|
||||
reload() {
|
||||
ebegin "Reloading automounter"
|
||||
if [ ! -r "${PIDFILE}" ]; then
|
||||
eend 1 "automount not running"
|
||||
else
|
||||
kill -s HUP $(cat "${PIDFILE}") 2> /dev/null
|
||||
eend $?
|
||||
fi
|
||||
}
|
Loading…
Reference in New Issue
Block a user