diff options
author | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-02-01 18:27:11 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-03-13 05:51:39 +0300 |
commit | 6e60e8b2b2bab889379b380a28a167a0edd9d1d3 (patch) | |
tree | f12f54d5ba8e74e67e5fad3651a1e125bb8f4191 /import-layers/meta-openembedded/meta-oe/recipes-extended/redis | |
parent | 509842add85b53e13164c1569a1fd43d5b8d91c5 (diff) | |
download | openbmc-6e60e8b2b2bab889379b380a28a167a0edd9d1d3.tar.xz |
Yocto 2.3
Move OpenBMC to Yocto 2.3(pyro).
Tested: Built and verified Witherspoon and Palmetto images
Change-Id: I50744030e771f4850afc2a93a10d3507e76d36bc
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Resolves: openbmc/openbmc#2461
Diffstat (limited to 'import-layers/meta-openembedded/meta-oe/recipes-extended/redis')
3 files changed, 39 insertions, 5 deletions
diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/redis/redis/redis.conf b/import-layers/meta-openembedded/meta-oe/recipes-extended/redis/redis/redis.conf index 923b98e5c8..ab024ad852 100644 --- a/import-layers/meta-openembedded/meta-oe/recipes-extended/redis/redis/redis.conf +++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/redis/redis/redis.conf @@ -30,7 +30,7 @@ port 6379 # If you want you can bind a single interface, if the bind option is not # specified all the interfaces will listen for incoming connections. # -# bind 127.0.0.1 +bind 127.0.0.1 # Specify the path for the unix socket that will be used to listen for # incoming connections. There is no default, so Redis will not listen @@ -53,14 +53,14 @@ loglevel notice # Specify the log file name. Also 'stdout' can be used to force # Redis to log on the standard output. Note that if you use standard # output for logging but daemonize, logs will be sent to /dev/null -logfile /var/log/redis.log +# logfile /var/log/redis.log # To enable logging to the system logger, just set 'syslog-enabled' to yes, # and optionally update the other syslog parameters to suit your needs. -# syslog-enabled no +syslog-enabled yes # Specify the syslog identity. -# syslog-ident redis +syslog-ident redis # Specify the syslog facility. Must be USER or between LOCAL0-LOCAL7. # syslog-facility local0 diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/redis/redis/redis.service b/import-layers/meta-openembedded/meta-oe/recipes-extended/redis/redis/redis.service new file mode 100644 index 0000000000..36d29852da --- /dev/null +++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/redis/redis/redis.service @@ -0,0 +1,15 @@ +[Unit] +Description=Redis In-Memory Data Store +After=network.target + +[Service] +User=redis +Group=redis +ExecStart=/usr/bin/redis-server /etc/redis/redis.conf +ExecStop=/usr/bin/redis-cli shutdown +Restart=always +LimitNOFILE=10032 + +[Install] +WantedBy=multi-user.target + diff --git a/import-layers/meta-openembedded/meta-oe/recipes-extended/redis/redis_3.0.2.bb b/import-layers/meta-openembedded/meta-oe/recipes-extended/redis/redis_3.0.2.bb index 2e4b760cc1..9395b33b08 100644 --- a/import-layers/meta-openembedded/meta-oe/recipes-extended/redis/redis_3.0.2.bb +++ b/import-layers/meta-openembedded/meta-oe/recipes-extended/redis/redis_3.0.2.bb @@ -12,13 +12,21 @@ SRC_URI = "http://download.redis.io/releases/${BP}.tar.gz \ file://oe-use-libc-malloc.patch \ file://redis.conf \ file://init-redis-server \ + file://redis.service \ file://hiredis-update-Makefile-to-add-symbols-to-staticlib.patch \ " SRC_URI[md5sum] = "87be8867447f62524b584813e5a7bd14" SRC_URI[sha256sum] = "93e422c0d584623601f89b956045be158889ebe594478a2c24e1bf218495633f" -inherit autotools-brokensep update-rc.d +inherit autotools-brokensep update-rc.d systemd useradd + +USERADD_PACKAGES = "${PN}" +USERADD_PARAM_${PN} = "--system --home-dir /var/lib/redis -g redis --shell /bin/false redis" +GROUPADD_PARAM_${PN} = "--system redis" + + +REDIS_ON_SYSTEMD = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}" do_install() { export PREFIX=${D}/${prefix} @@ -28,9 +36,20 @@ do_install() { install -d ${D}/${sysconfdir}/init.d install -m 0755 ${WORKDIR}/init-redis-server ${D}/${sysconfdir}/init.d/redis-server install -d ${D}/var/lib/redis/ + chown redis.redis ${D}/var/lib/redis/ + + install -d ${D}${systemd_system_unitdir} + install -m 0644 ${WORKDIR}/redis.service ${D}${systemd_system_unitdir} + sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${systemd_system_unitdir}/redis.service + + if [ "${REDIS_ON_SYSTEMD}" = true ]; then + sed -i 's!daemonize yes!# daemonize yes!' ${D}/${sysconfdir}/redis/redis.conf + fi } CONFFILES_${PN} = "${sysconfdir}/redis/redis.conf" INITSCRIPT_NAME = "redis-server" INITSCRIPT_PARAMS = "defaults 87" + +SYSTEMD_SERVICE_${PN} = "redis.service" |