Blame scripts/memcached.service

Packit Service 584ef9
# It's not recommended to modify this file in-place, because it will be
Packit Service 584ef9
# overwritten during upgrades.  If you want to customize, the best
Packit Service 584ef9
# way is to use the "systemctl edit" command to create an override unit.
Packit Service 584ef9
#
Packit Service 584ef9
# For example, to pass additional options, create an override unit
Packit Service 584ef9
# (as is done by systemctl edit) and enter the following:
Packit Service 584ef9
#
Packit Service 584ef9
#     [Service]
Packit Service 584ef9
#     Environment=OPTIONS="-l 127.0.0.1,::1"
Packit Service 584ef9
Packit Service 584ef9
Packit Service 584ef9
[Unit]
Packit Service 584ef9
Description=memcached daemon
Packit Service 6a99c3
Before=httpd.service
Packit Service 584ef9
After=network.target
Packit Service 584ef9
Packit Service 584ef9
[Service]
Packit Service 584ef9
EnvironmentFile=/etc/sysconfig/memcached
Packit Service 584ef9
ExecStart=/usr/bin/memcached -p ${PORT} -u ${USER} -m ${CACHESIZE} -c ${MAXCONN} $OPTIONS
Packit Service 584ef9
Packit Service 584ef9
# Set up a new file system namespace and mounts private /tmp and /var/tmp
Packit Service 584ef9
# directories so this service cannot access the global directories and
Packit Service 584ef9
# other processes cannot access this service's directories.
Packit Service 584ef9
PrivateTmp=true
Packit Service 584ef9
Packit Service 584ef9
# Mounts the /usr, /boot, and /etc directories read-only for processes
Packit Service 584ef9
# invoked by this unit.
Packit Service 584ef9
ProtectSystem=full
Packit Service 584ef9
Packit Service 584ef9
# Ensures that the service process and all its children can never gain new
Packit Service 584ef9
# privileges
Packit Service 584ef9
NoNewPrivileges=true
Packit Service 584ef9
Packit Service 584ef9
# Sets up a new /dev namespace for the executed processes and only adds API
Packit Service 584ef9
# pseudo devices such as /dev/null, /dev/zero or /dev/random (as well as
Packit Service 584ef9
# the pseudo TTY subsystem) to it, but no physical devices such as /dev/sda.
Packit Service 584ef9
PrivateDevices=true
Packit Service 584ef9
Packit Service 584ef9
# Required for dropping privileges and running as a different user
Packit Service 584ef9
CapabilityBoundingSet=CAP_SETGID CAP_SETUID CAP_SYS_RESOURCE
Packit Service 584ef9
Packit Service 584ef9
# Restricts the set of socket address families accessible to the processes
Packit Service 584ef9
# of this unit. Protects against vulnerabilities such as CVE-2016-8655
Packit Service 584ef9
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX
Packit Service 584ef9
Packit Service 584ef9
Packit Service 584ef9
# Some security features are not in the older versions of systemd used by
Packit Service 584ef9
# e.g. RHEL7/CentOS 7. The below settings are automatically edited at package
Packit Service 584ef9
# build time to uncomment them if the target platform supports them.
Packit Service 584ef9
Packit Service 584ef9
# Attempts to create memory mappings that are writable and executable at
Packit Service 584ef9
# the same time, or to change existing memory mappings to become executable
Packit Service 584ef9
# are prohibited.
Packit Service 584ef9
##safer##MemoryDenyWriteExecute=true
Packit Service 584ef9
Packit Service 584ef9
# Explicit module loading will be denied. This allows to turn off module
Packit Service 584ef9
# load and unload operations on modular kernels. It is recommended to turn
Packit Service 584ef9
# this on for most services that do not need special file systems or extra
Packit Service 584ef9
# kernel modules to work.
Packit Service 584ef9
##safer##ProtectKernelModules=true
Packit Service 584ef9
Packit Service 584ef9
# Kernel variables accessible through /proc/sys, /sys, /proc/sysrq-trigger,
Packit Service 584ef9
# /proc/latency_stats, /proc/acpi, /proc/timer_stats, /proc/fs and /proc/irq
Packit Service 584ef9
# will be made read-only to all processes of the unit. Usually, tunable
Packit Service 584ef9
# kernel variables should only be written at boot-time, with the sysctl.d(5)
Packit Service 584ef9
# mechanism. Almost no services need to write to these at runtime; it is hence
Packit Service 584ef9
# recommended to turn this on for most services.
Packit Service 584ef9
##safer##ProtectKernelTunables=true
Packit Service 584ef9
Packit Service 584ef9
# The Linux Control Groups (cgroups(7)) hierarchies accessible through
Packit Service 584ef9
# /sys/fs/cgroup will be made read-only to all processes of the unit.
Packit Service 584ef9
# Except for container managers no services should require write access
Packit Service 584ef9
# to the control groups hierarchies; it is hence recommended to turn this
Packit Service 584ef9
# on for most services
Packit Service 584ef9
##safer##ProtectControlGroups=true
Packit Service 584ef9
Packit Service 584ef9
# Any attempts to enable realtime scheduling in a process of the unit are
Packit Service 584ef9
# refused.
Packit Service 584ef9
##safer##RestrictRealtime=true
Packit Service 584ef9
Packit Service 584ef9
# Takes away the ability to create or manage any kind of namespace
Packit Service 584ef9
##safer##RestrictNamespaces=true
Packit Service 584ef9
Packit Service 584ef9
[Install]
Packit Service 584ef9
WantedBy=multi-user.target