This file is indexed.

postinst is in obs-server 2.7.4-2.

This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
#!/bin/sh -e

if ! getent group obsrun > /dev/null; then
    addgroup --system --quiet obsrun
fi

if ! getent passwd obsrun > /dev/null; then
    adduser --system --quiet \
        --ingroup obsrun --shell /bin/false \
        --home /usr/lib/obs --no-create-home \
        --shell /bin/false obsrun
    usermod -c "User for build service backend" obsrun
fi

if ! getent passwd obsservicerun > /dev/null; then
    adduser --system --quiet \
        --ingroup obsrun --shell /bin/false \
        --home /usr/lib/obs/server --no-create-home \
        --shell /bin/false obsservicerun
    usermod -c "User for obs source service server" obsservicerun
fi

mkdir -p /srv/obs/repos
chown obsrun:obsrun /srv/obs/repos

# Start up schedulers
#deb-systemd-helper enable obsscheduler\@i586.service
#deb-systemd-helper enable obsscheduler\@x86_64.service
#deb-systemd-helper enable obsscheduler\@armv7hl.service
# FIXME manually creating symlink, deb-systemd-helper does not support
# template services yet. See #801822
# FIXME make sure multi-user.target.wants directory created before creating symlink. See #870841
mkdir -p /etc/systemd/system/multi-user.target.wants
ln -sf /lib/systemd/system/obsscheduler@.service \
   /etc/systemd/system/multi-user.target.wants/obsscheduler\@i586.service
ln -sf /lib/systemd/system/obsscheduler@.service \
   /etc/systemd/system/multi-user.target.wants/obsscheduler\@x86_64.service
ln -sf /lib/systemd/system/obsscheduler@.service \
   /etc/systemd/system/multi-user.target.wants/obsscheduler\@armv7hl.service
# tell systemd to reload
if [ -d /run/systemd/system ]; then
  systemctl --system daemon-reload >/dev/null || true
fi
invoke-rc.d obsscheduler@i586 start || true
invoke-rc.d obsscheduler@x86_64 start || true
invoke-rc.d obsscheduler@armv7hl start || true

# Automatically added by dh_systemd_enable/10.7.2ubuntu2
# This will only remove masks created by d-s-h on package removal.
deb-systemd-helper unmask obsdispatcher.service >/dev/null || true

# was-enabled defaults to true, so new installations run enable.
if deb-systemd-helper --quiet was-enabled obsdispatcher.service; then
	# Enables the unit on first installation, creates new
	# symlinks on upgrades if the unit file has changed.
	deb-systemd-helper enable obsdispatcher.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 obsdispatcher.service >/dev/null || true
fi
# End automatically added section
# Automatically added by dh_systemd_enable/10.7.2ubuntu2
# This will only remove masks created by d-s-h on package removal.
deb-systemd-helper unmask obsdodup.service >/dev/null || true

# was-enabled defaults to true, so new installations run enable.
if deb-systemd-helper --quiet was-enabled obsdodup.service; then
	# Enables the unit on first installation, creates new
	# symlinks on upgrades if the unit file has changed.
	deb-systemd-helper enable obsdodup.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 obsdodup.service >/dev/null || true
fi
# End automatically added section
# Automatically added by dh_systemd_enable/10.7.2ubuntu2
# This will only remove masks created by d-s-h on package removal.
deb-systemd-helper unmask obspublisher.service >/dev/null || true

# was-enabled defaults to true, so new installations run enable.
if deb-systemd-helper --quiet was-enabled obspublisher.service; then
	# Enables the unit on first installation, creates new
	# symlinks on upgrades if the unit file has changed.
	deb-systemd-helper enable obspublisher.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 obspublisher.service >/dev/null || true
fi
# End automatically added section
# Automatically added by dh_systemd_enable/10.7.2ubuntu2
# This will only remove masks created by d-s-h on package removal.
deb-systemd-helper unmask obsrepserver.service >/dev/null || true

# was-enabled defaults to true, so new installations run enable.
if deb-systemd-helper --quiet was-enabled obsrepserver.service; then
	# Enables the unit on first installation, creates new
	# symlinks on upgrades if the unit file has changed.
	deb-systemd-helper enable obsrepserver.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 obsrepserver.service >/dev/null || true
fi
# End automatically added section
# Automatically added by dh_systemd_enable/10.7.2ubuntu2
# This will only remove masks created by d-s-h on package removal.
deb-systemd-helper unmask obssigner.service >/dev/null || true

# was-enabled defaults to true, so new installations run enable.
if deb-systemd-helper --quiet was-enabled obssigner.service; then
	# Enables the unit on first installation, creates new
	# symlinks on upgrades if the unit file has changed.
	deb-systemd-helper enable obssigner.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 obssigner.service >/dev/null || true
fi
# End automatically added section
# Automatically added by dh_systemd_enable/10.7.2ubuntu2
# This will only remove masks created by d-s-h on package removal.
deb-systemd-helper unmask obssrcserver.service >/dev/null || true

# was-enabled defaults to true, so new installations run enable.
if deb-systemd-helper --quiet was-enabled obssrcserver.service; then
	# Enables the unit on first installation, creates new
	# symlinks on upgrades if the unit file has changed.
	deb-systemd-helper enable obssrcserver.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 obssrcserver.service >/dev/null || true
fi
# End automatically added section
# Automatically added by dh_systemd_enable/10.7.2ubuntu2
# This will only remove masks created by d-s-h on package removal.
deb-systemd-helper unmask obswarden.service >/dev/null || true

# was-enabled defaults to true, so new installations run enable.
if deb-systemd-helper --quiet was-enabled obswarden.service; then
	# Enables the unit on first installation, creates new
	# symlinks on upgrades if the unit file has changed.
	deb-systemd-helper enable obswarden.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 obswarden.service >/dev/null || true
fi
# End automatically added section
# Automatically added by dh_systemd_start/10.7.2ubuntu2
if [ -d /run/systemd/system ]; then
	systemctl --system daemon-reload >/dev/null || true
	deb-systemd-invoke start obsdispatcher.service obsdodup.service obspublisher.service obsrepserver.service obssigner.service obssrcserver.service obswarden.service >/dev/null || true
fi
# End automatically added section