diff options
author | Chris Fordham | 2016-02-13 17:25:23 +1100 |
---|---|---|
committer | Chris Fordham | 2016-02-13 17:25:23 +1100 |
commit | 68c3a5638ea86b0e0bdd62be52a5a67a7c29a1b8 (patch) | |
tree | 36ec00d3586342432ee1f43b707484357a59d573 | |
download | aur-68c3a5638ea86b0e0bdd62be52a5a67a7c29a1b8.tar.gz |
Add rightlink-bin package.
-rw-r--r-- | .SRCINFO | 24 | ||||
-rw-r--r-- | .gitignore | 5 | ||||
-rw-r--r-- | 90-rightscale | 12 | ||||
-rw-r--r-- | PKGBUILD | 37 | ||||
-rw-r--r-- | rightlink.install | 68 |
5 files changed, 146 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..b39fbad2bb1e --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,24 @@ +# Generated by mksrcinfo v8 +# Sat Feb 13 06:24:58 UTC 2016 +pkgbase = rightlink-bin + pkgdesc = RightLink version 10 (RL10) is a new version of RightScale's server agent that connects servers managed through RightScale to the RightScale cloud management platform. + pkgver = 10.3.0 + pkgrel = 1 + url = http://docs.rightscale.com/release-notes/right-link-10.html + install = rightlink.install + arch = x86_64 + license = RightScale + depends = cloud-init + provides = rightlink + conflicts = rightscale + replaces = rightscale + options = emptydirs + options = strip + options = !docs + options = !libtool + options = !staticlibs + source = https://rightlink.rightscale.com/rll/10.3.0/rightlink.tgz + md5sums = 22080fefbc3c46790bcd29f7261f50e1 + +pkgname = rightlink-bin + diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..3cd0a4653650 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +/src/ +/pkg/ +*.tgz +*.pkg.tar.xz + diff --git a/90-rightscale b/90-rightscale new file mode 100644 index 000000000000..e33e05271bd3 --- /dev/null +++ b/90-rightscale @@ -0,0 +1,12 @@ +# Rightlink service startup requires these directives: +Defaults:root !requiretty +Defaults:rightlink !requiretty +Defaults:rightlink !env_reset +root ALL=(ALL) SETENV:ALL +# Blanket permissions. If you wish to remove the NOPASSWD:ALL line and tighten +# permissions, you must add in permissions for (1) lifecycle management (reboot/terminate) +# via /sbin/init and (2) managed login. The minimal set of permissions to do this +# are given below. The first line below would allow (1) and second would allow (2) +# rightlink ALL=(root) NOPASSWD:/sbin/init +# rightlink ALL=(rightscale) NOPASSWD:/usr/bin/tee /home/rightscale/.ssh/authorized_keys +rightlink ALL=(ALL) SETENV:NOPASSWD:ALL diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..33be6e4ffa31 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,37 @@ +# $Id$ +# Maintainer: Chris Fordham <chris [at] fordham [hyphon] nagy [dot] id [dot] au> aka flaccid + +pkgname=rightlink-bin +pkgver=10.3.0 +pkgrel=1 +pkgdesc="RightLink version 10 (RL10) is a new version of RightScale's server agent that connects servers managed through RightScale to the RightScale cloud management platform." +license=('RightScale') +arch=('x86_64') +url="http://docs.rightscale.com/release-notes/right-link-10.html" +license=(RightScale) +conflicts=(rightscale) +replaces=(rightscale) +depends=('cloud-init') +provides=('rightlink') +source=("https://rightlink.rightscale.com/rll/$pkgver/rightlink.tgz") +md5sums=('22080fefbc3c46790bcd29f7261f50e1') +install='rightlink.install' +options=(emptydirs strip !docs !libtool !staticlibs) + +package() { + install -D -m755 "$srcdir/rightlink/rightlink" "$pkgdir/usr/bin/rightlink" + install -D -m755 "$srcdir/rightlink/rightlink" "$pkgdir/usr/bin/rsc" + install -D -m644 "$srcdir/rightlink/rightlink.service" "$pkgdir/usr/lib/systemd/system/rightlink.service" + install -D -m440 "$startdir/90-rightscale" "$pkgdir/etc/sudoers.d/90-rightscale" + + # add a symlink for the binary in /usr/local/bin to support + # the systemd service included in the source + install -d "$pkgdir/usr/local/bin" + cd "$pkgdir/usr/local/bin" + ln -sf /usr/bin/rightlink ./rightlink + + # ensure these folders match standard permissions on filesystem + chmod 750 "$pkgdir/etc/sudoers.d" +} + +# vim:set ts=2 sw=2 et: diff --git a/rightlink.install b/rightlink.install new file mode 100644 index 000000000000..c80efb73295b --- /dev/null +++ b/rightlink.install @@ -0,0 +1,68 @@ +enable_start_service() { + systemctl enable rightlink + systemctl start rightlink --no-block +} + +add_rightlink_user() { + if ! id -u rightlink >/dev/null 2>&1; then + useradd -c "rightlink service" -m -d /home/rightlink -U -s /bin/false rightlink + fi +} + +post_any() { + touch /var/lib/rightscale-identity + chmod 0600 /var/lib/rightscale-identity + + add_rightlink_user + + useradd -c "RightScale Managed Login" -d /home/rightscale -s /bin/bash -m rightscale &>/dev/null + + mkdir -p /home/rightscale/.ssh + touch /home/rightscale/.ssh/authorized_keys + chmod -R go-rwx /home/rightscale/.ssh + chown -R rightscale /home/rightscale/.ssh + + # Change the cloud-init config to run user-data script at every boot so we pull in updated + # user-data after a stop&start. This is a bit of a hack, but it's not clear what else to do that + # is clean. Somehow using once-per-instance doesn't actually work, at least not on CentOS7 or + # Fedora 20. Sigh + if [[ -w /etc/cloud/cloud.cfg ]]; then + sed -i -e '/ - scripts-user$/s/scripts-user/[scripts-user, always]/' /etc/cloud/cloud.cfg + #sed -i -e '/ - scripts-user$/s/scripts-user/[scripts-user, once-per-instance]/' /etc/cloud/cloud.cfg + else + echo "Cannot fix /etc/cloud/cloud.cfg to run user-data script at every boot: stop/start may not work" + fi + + # enable_start_service + + echo + echo 'If you are not bootstrapping a cloud instance automatically:' + echo ' - Ensure you have populated /var/lib/rightscale-identity' + echo ' before starting the system service!' + echo ' (see the User Data field on the Info tab of your server)' + echo + echo "==> To enable the RightScale RightLink service:" + echo "# systemctl enable rightlink.service" + echo + echo "==> To start RightScale RightLink:" + echo "# systemctl start rightlink.service" +} + +post_install() { + post_any +} + +post_upgrade() { + systemctl daemon-reload + post_any + echo + echo "==> To restart RightScale RightLink with the new version (when upgrading):" + echo "# systemctl restart rightlink.service" +} + +post_remove() { + systemctl disable rightlink > /dev/null 2>&1 || true + systemctl stop rightlink > /dev/null 2>&1 || true +} + +# vim:set ts=2 sw=2 et: |