Created
October 9, 2021 00:04
-
-
Save dsh0005/ec3d1de3a2a60b28acd3013f169a43ba to your computer and use it in GitHub Desktop.
Custom pcscd rc file to enforce memory limits
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# PROVIDE: pcscd | |
# REQUIRE: LOGIN | |
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf | |
# to enable this service: | |
# | |
# pcscd_enable="YES" | |
. /etc/rc.subr | |
name="pcscd" | |
rcvar=pcscd_enable | |
command="/usr/local/sbin/pcscd" | |
pcscd_ulimit(){ | |
#echo "Setting ulimit for pcscd." | |
/usr/bin/limits -B -m 128m -v 256m /usr/local/sbin/pcscd | |
} | |
start_cmd="pcscd_ulimit" | |
load_rc_config "$name" | |
: ${pcscd_enable="NO"} | |
run_rc_command "$1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment