Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
replds
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai3
tools
replds
Commits
588f7c97
Commit
588f7c97
authored
Oct 23, 2019
by
ale
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create systemd snippet to set process group if necessary
parent
2329592e
Pipeline
#4785
passed with stages
in 1 minute and 24 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
debian/replds-instance-create
debian/replds-instance-create
+24
-0
No files found.
debian/replds-instance-create
View file @
588f7c97
#!/bin/sh
#
# Create a new replds instance.
#
# The new instance will have its own configuration in
# /etc/replds/<name>.yml, its data directory in
# /var/lib/replds/<name>, and its own system user and group.
#
# If the '-g <group>' option is passed, the new instance will use the
# specified UNIX group. Permissions of the data directory will be set
# accordingly, and the systemd configuration will be modified.
#
# You are expected to invoke 'systemctl enable replds@<name>.service'
# yourself.
instance
=
data_group
=
...
...
@@ -48,6 +61,17 @@ if [ -n "${data_group}" ]; then
usermod
--append
--groups
${
data_group
}
${
instance_user
}
fi
# If data_group is specified, create a customized snippet for systemd
# to set the data_group for the running process.
if
[
-n
"
${
data_group
}
"
]
;
then
systemd_dir
=
"/etc/systemd/system/replds@
${
instance
}
.service.d"
mkdir
-p
${
systemd_dir
}
cat
>
${
systemd_dir
}
/group.conf
<<
EOF
[Service]
Group=
${
data_group
}
EOF
fi
# Create the repository directory.
if
[
!
-e
${
instance_dir
}
]
;
then
mkdir
-p
${
instance_dir
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment