-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
45526a1
commit 8d1e9a3
Showing
4 changed files
with
142 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# == Class: pureftpd::config::exauth | ||
# | ||
# Manages the pure-ftpd external authentication. This class should be considered | ||
# private. | ||
# | ||
# | ||
|
||
class pureftpd::config::extauth($extauth_handler) { | ||
|
||
|
||
notify {$extauth_handler:} | ||
|
||
if $extauth_handler =~ /^puppet:\/\// { | ||
|
||
$tmp = split($extauth_handler,'/') | ||
$leght = size($tmp) | ||
$filename = $tmp[$size-1] | ||
|
||
file {"/etc/pure-ftpd/${filename}": | ||
ensure => file, | ||
owner => 'root', | ||
group => 'root', | ||
mode => '0755', | ||
source => $extauth_handler, | ||
notify => Service['pure-authd'], | ||
} | ||
} else { | ||
$filename = $extauth_handler | ||
} | ||
|
||
file {'/etc/init.d/pure-authd': | ||
ensure => file, | ||
owner => 'root', | ||
group => 'root', | ||
mode => '0755', | ||
content => template('pureftpd/pure-authd.erb') | ||
} | ||
|
||
service {'pure-authd': | ||
ensure => running, | ||
enable => true, | ||
hasrestart => true, | ||
hasstatus => true, | ||
require => File['/etc/init.d/pure-authd'] | ||
} | ||
|
||
} |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
#!/bin/bash | ||
# | ||
# Startup script for the pure-authd FTP Server $Revision: 1.1 $ | ||
# | ||
# chkconfig: - 85 15 | ||
# description: Pure-FTPd is an FTP auth daemon based upon Troll-FTPd | ||
# processname: pure-authd | ||
# pidfile: /var/run/pure-authd.pid | ||
|
||
# Source function library. | ||
. /etc/init.d/functions | ||
|
||
# Source networking configuration. | ||
. /etc/sysconfig/network | ||
|
||
# Check that networking is configured. | ||
[ ${NETWORKING} = "no" ] && exit 0 | ||
|
||
RETVAL=0 | ||
|
||
prog="pure-authd" | ||
|
||
# Path to the pure-ftp binaries. | ||
fullpath=/usr/sbin/pure-authd | ||
pidfile="/var/run/pure-authd.pid" | ||
pure_config="-p $pidfile -B -s /var/run/ftpd.sock -r <%= @filename %>" | ||
|
||
|
||
start() { | ||
echo -n $"Starting $prog: " | ||
daemon --pidfile $pidfile "$fullpath $pure_config > /dev/null" | ||
RETVAL=$? | ||
[ $RETVAL = 0 ] && touch /var/lock/subsys/pure-authd | ||
echo | ||
} | ||
|
||
stop() { | ||
echo -n $"Stopping $prog: " | ||
killproc pure-authd | ||
RETVAL=$? | ||
[ $RETVAL = 0 ] && rm -f /var/lock/subsys/pure-authd | ||
echo | ||
} | ||
|
||
# See how we were called. | ||
case "$1" in | ||
start) | ||
start | ||
;; | ||
stop) | ||
stop | ||
;; | ||
restart) | ||
stop | ||
start | ||
;; | ||
reload) | ||
echo -n $"Reloading $prog: " | ||
killproc pure-ftpd -HUP | ||
RETVAL=$? | ||
echo | ||
;; | ||
condrestart) | ||
if [ -f /var/lock/subsys/pure-authd ] ; then | ||
stop | ||
# avoid race | ||
sleep 3 | ||
start | ||
fi | ||
;; | ||
status) | ||
status pure-authd | ||
RETVAL=$? | ||
;; | ||
*) | ||
echo $"Usage: pure-authd {start|stop|restart|status}" | ||
RETVAL=1 | ||
esac | ||
exit $RETVAL |