Website : rimsha.abasa.com
backdoor
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
var
/
lib
/
dpkg
/
info
/
Filename :
jenkins.postinst
back
Copy
#!/bin/sh # postinst script for jenkins # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * <postinst> `configure' <most-recently-configured-version> # * <old-postinst> `abort-upgrade' <new version> # * <conflictor's-postinst> `abort-remove' `in-favour' <package> # <new-version> # * <postinst> `abort-remove' # * <deconfigured's-postinst> `abort-deconfigure' `in-favour' # <failed-install-package> <version> `removing' # <conflicting-package> <version> # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in configure) if [ -d /run/systemd/system ]; then # TODO --value would eliminate the need for cut, but older versions of systemd do not support it JENKINS_USER=$(systemctl show jenkins --property=User 2>/dev/null | cut -d= -f2-) JENKINS_GROUP=$(systemctl show jenkins --property=Group 2>/dev/null | cut -d= -f2-) elif [ -r /etc/default/jenkins ]; then . /etc/default/jenkins fi : "${JENKINS_USER:=jenkins}" : "${JENKINS_GROUP:=jenkins}" # Create jenkins group and user if they don't exist. # sometimes tools that users want Jenkins to run need a shell, # so use /bin/bash. See JENKINS-4830 if ! getent group "$JENKINS_GROUP" >/dev/null; then addgroup --system --quiet "$JENKINS_GROUP" fi if ! id "$JENKINS_USER" >/dev/null 2>&1; then adduser --system --quiet --home /var/lib/jenkins --no-create-home \ --ingroup "$JENKINS_GROUP" --disabled-password --shell /bin/bash \ --gecos 'Jenkins' \ "$JENKINS_USER" fi # directories needed for jenkins # we don't do -R because it can take a long time on big installation chown "${JENKINS_USER}:${JENKINS_GROUP}" /var/lib/jenkins /var/log/jenkins # we don't do "chmod 750" so that the user can choose the pemission for g and o on their own chmod u+rwx /var/lib/jenkins /var/log/jenkins # make sure jenkins can delete everything in /var/cache/jenkins to # re-explode war. chown -R "${JENKINS_USER}:${JENKINS_GROUP}" /var/cache/jenkins chmod -R 750 /var/cache/jenkins # older installations may use /var/run/jenkins # so make sure that they can delete too. if [ -d "/var/run/jenkins" ]; then chown -R "${JENKINS_USER}:${JENKINS_GROUP}" /var/run/jenkins chmod -R 750 /var/run/jenkins fi /usr/share/jenkins/migrate /etc/default/jenkins || true ;; abort-upgrade | abort-remove | abort-deconfigure) ;; \ *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. # Automatically added by dh_installtmpfiles/13.14.1ubuntu5 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then if [ -x "$(command -v systemd-tmpfiles)" ]; then systemd-tmpfiles ${DPKG_ROOT:+--root="$DPKG_ROOT"} --create jenkins.conf || true fi fi # End automatically added section # Automatically added by dh_installinit/13.14.1ubuntu5 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then if [ -z "${DPKG_ROOT:-}" ] && [ -x "/etc/init.d/jenkins" ]; then update-rc.d jenkins defaults >/dev/null if [ -n "$2" ]; then _dh_action=restart else _dh_action=start fi invoke-rc.d --skip-systemd-native jenkins $_dh_action || exit 1 fi fi # End automatically added section # Automatically added by dh_installsystemd/13.14.1ubuntu5 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then # The following line should be removed in trixie or trixie+1 deb-systemd-helper unmask 'jenkins.service' >/dev/null || true # was-enabled defaults to true, so new installations run enable. if deb-systemd-helper --quiet was-enabled 'jenkins.service'; then # Enables the unit on first installation, creates new # symlinks on upgrades if the unit file has changed. deb-systemd-helper enable 'jenkins.service' >/dev/null || true else # Update the statefile to add new symlinks (if any), which need to be # cleaned up on purge. Also remove old symlinks. deb-systemd-helper update-state 'jenkins.service' >/dev/null || true fi fi # End automatically added section # Automatically added by dh_installsystemd/13.14.1ubuntu5 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then if [ -d /run/systemd/system ]; then systemctl --system daemon-reload >/dev/null || true if [ -n "$2" ]; then _dh_action=restart else _dh_action=start fi deb-systemd-invoke $_dh_action 'jenkins.service' >/dev/null || true fi fi # End automatically added section exit 0