More stack user removals.
This commit is contained in:
parent
88d54996db
commit
067163dfd1
2 changed files with 10 additions and 8 deletions
|
@ -1,5 +1,5 @@
|
||||||
uid = stack
|
uid = %USER%
|
||||||
gid = stack
|
gid = %GROUP%
|
||||||
log file = /var/log/rsyncd.log
|
log file = /var/log/rsyncd.log
|
||||||
pid file = /var/run/rsyncd.pid
|
pid file = /var/run/rsyncd.pid
|
||||||
address = 127.0.0.1
|
address = 127.0.0.1
|
||||||
|
|
14
stack.sh
14
stack.sh
|
@ -121,7 +121,7 @@ if [[ $EUID -eq 0 ]]; then
|
||||||
echo "Copying files to stack user"
|
echo "Copying files to stack user"
|
||||||
STACK_DIR="$DEST/${PWD##*/}"
|
STACK_DIR="$DEST/${PWD##*/}"
|
||||||
cp -r -f "$PWD" "$STACK_DIR"
|
cp -r -f "$PWD" "$STACK_DIR"
|
||||||
chown -R stack "$STACK_DIR"
|
chown -R $USER "$STACK_DIR"
|
||||||
if [[ "$SHELL_AFTER_RUN" != "no" ]]; then
|
if [[ "$SHELL_AFTER_RUN" != "no" ]]; then
|
||||||
exec su -c "set -e; cd $STACK_DIR; bash stack.sh; bash" stack
|
exec su -c "set -e; cd $STACK_DIR; bash stack.sh; bash" stack
|
||||||
else
|
else
|
||||||
|
@ -604,14 +604,16 @@ fi
|
||||||
|
|
||||||
# Storage Service
|
# Storage Service
|
||||||
if [[ "$ENABLED_SERVICES" =~ "swift" ]];then
|
if [[ "$ENABLED_SERVICES" =~ "swift" ]];then
|
||||||
|
USER_GROUP=$(id -g)
|
||||||
|
|
||||||
sudo mkdir -p ${SWIFT_LOCATION}/drives
|
sudo mkdir -p ${SWIFT_LOCATION}/drives
|
||||||
sudo chown -R stack: ${SWIFT_LOCATION}/drives
|
sudo chown -R $USER: ${SWIFT_LOCATION}/drives
|
||||||
s=${SWIFT_LOCATION}/drives/sdb1 # Shortcut variable
|
s=${SWIFT_LOCATION}/drives/sdb1 # Shortcut variable
|
||||||
|
|
||||||
# Create a loopback disk and format it with XFS.
|
# Create a loopback disk and format it with XFS.
|
||||||
if [[ ! -e ${SWIFT_LOCATION}/swift-disk ]];then
|
if [[ ! -e ${SWIFT_LOCATION}/swift-disk ]];then
|
||||||
sudo touch ${SWIFT_LOCATION}/swift-disk
|
sudo touch ${SWIFT_LOCATION}/swift-disk
|
||||||
sudo chown stack: ${SWIFT_LOCATION}/swift-disk
|
sudo chown $USER: ${SWIFT_LOCATION}/swift-disk
|
||||||
|
|
||||||
dd if=/dev/zero of=${SWIFT_LOCATION}/swift-disk bs=1024 count=0 seek=${SWIFT_LOOPBACK_DISK_SIZE}
|
dd if=/dev/zero of=${SWIFT_LOCATION}/swift-disk bs=1024 count=0 seek=${SWIFT_LOOPBACK_DISK_SIZE}
|
||||||
mkfs.xfs -f -i size=1024 ${SWIFT_LOCATION}/swift-disk
|
mkfs.xfs -f -i size=1024 ${SWIFT_LOCATION}/swift-disk
|
||||||
|
@ -637,13 +639,13 @@ if [[ "$ENABLED_SERVICES" =~ "swift" ]];then
|
||||||
for d in ${s}/{1..4} /etc/swift /etc/swift/{object,container,account}-server \
|
for d in ${s}/{1..4} /etc/swift /etc/swift/{object,container,account}-server \
|
||||||
${SWIFT_LOCATION}/{1..4}/node/sdb1 /var/run/swift ;do
|
${SWIFT_LOCATION}/{1..4}/node/sdb1 /var/run/swift ;do
|
||||||
[[ -d $d ]] && continue
|
[[ -d $d ]] && continue
|
||||||
sudo install -o ${USER} -d $d
|
sudo install -o ${USER} -g $USER_GROUP -d $d
|
||||||
done
|
done
|
||||||
|
|
||||||
sudo chown -R stack: ${SWIFT_LOCATION}/{1..4}/node
|
sudo chown -R $USER: ${SWIFT_LOCATION}/{1..4}/node
|
||||||
|
|
||||||
# Add rsync file
|
# Add rsync file
|
||||||
sed -e "s,%SWIFT_LOCATION%,$SWIFT_LOCATION," $FILES/swift-rsyncd.conf | sudo tee /etc/rsyncd.conf
|
sed -e "s/%GROUP%/${USER_GROUP}/;s/%USER%/$USER/;s,%SWIFT_LOCATION%,$SWIFT_LOCATION," $FILES/swift-rsyncd.conf | sudo tee /etc/rsyncd.conf
|
||||||
sudo sed -i '/^RSYNC_ENABLE=false/ { s/false/true/ }' /etc/default/rsync
|
sudo sed -i '/^RSYNC_ENABLE=false/ { s/false/true/ }' /etc/default/rsync
|
||||||
|
|
||||||
if [[ "$ENABLED_SERVICES" =~ "key" ]]; then
|
if [[ "$ENABLED_SERVICES" =~ "key" ]]; then
|
||||||
|
|
Loading…
Reference in a new issue