| 1 | #!/sbin/openrc-run |
| 2 | |
| 3 | extra_commands="checkconfig" |
| 4 | cfg="/etc/nslcd.conf" |
| 5 | command=/usr/sbin/nslcd |
| 6 | pidfile=/var/run/nslcd/nslcd.pid |
| 7 | |
| 8 | |
| 9 | depend() { |
| 10 | need net |
| 11 | after firewall |
| 12 | use dns logger |
| 13 | } |
| 14 | |
| 15 | checkconfig() { |
| 16 | if [ -f "$cfg" ] ; then |
| 17 | return 0 |
| 18 | fi |
| 19 | eerror "Please create $cfg" |
| 20 | eerror "Example config: /usr/share/nss-ldapd/nslcd.conf" |
| 21 | return 1 |
| 22 | } |
| 23 | |
| 24 | start_pre() { |
| 25 | checkpath -q -d ${pidfile%/*} -o nslcd:nslcd |
| 26 | checkconfig || return $? |
| 27 | } |