summaryrefslogtreecommitdiff
blob: 44056b0e50b786ff77d30d8bbfe4ae2bc345256a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/sbin/openrc-run
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

depend() {
	need localmount

	# Optional services (see ebuild)
	use tcsd
}

start() {
	# detect available tokens and set up
	# /var/lib/opencryptoki/pk_config_data
	ebegin "Preparing pkcs configuration"
	/usr/sbin/pkcs11_startup

	ebegin "Starting pkcsslotd"
	start-stop-daemon --start --exec /usr/sbin/pkcsslotd --pidfile /var/run/pkcsslotd.pid
	eend $? "Check your logs to see why startup failed"
}

stop() {
	ebegin "Stopping pkcsslotd"
	start-stop-daemon --stop --exec /usr/sbin/pkcsslotd --pidfile /var/run/pkcsslotd.pid
	eend $?
}