Ignore:
Timestamp:
Nov 22, 2011, 12:24:41 AM (13 years ago)
Author:
quentin
Message:
Package afsagent systemd and get rid of rc.local sysname hack
Location:
branches/fc15-dev/server/fedora
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/fc15-dev/server/fedora/config/etc/rc.d/rc.local

    r2061 r2063  
    44
    55/bin/mkdir -pm 1773 /tmp/sessions
    6 
    7 #### Set the AFS sysname. Ideally, this should go elsewhere, but this
    8 #### is a horrible hack to clean up after another horrible hack, so...
    9 
    10 /sbin/sysctl -q afs.GCPAGs=0
    11 /usr/bin/fs setcrypt on
    12 /usr/bin/fs sysname 'amd64_fedora15_scripts' 'amd64_fedora13_scripts' 'amd64_fedora11_scripts' 'amd64_fedora9_scripts' 'amd64_fedora7_scripts' 'scripts' 'amd64_fedora15' 'amd64_fedora13' 'amd64_fedora11' 'amd64_fedora9' 'amd64_fedora7' 'amd64_linux26' 'i386_deb60' 'i386_deb50' 'i386_deb40' 'i386_rhel4' 'i386_rhel3' 'i386_rh9' 'i386_linux26' 'i386_linux24' 'i386_linux22' 'i386_linux3' 'i386_linux2'
    13 
    14 /usr/bin/fs setcell -nosuid -c athena
  • branches/fc15-dev/server/fedora/specs/tokensys.spec

    r1836 r2063  
    1111%define debug_package %{nil}
    1212Prereq: /usr/bin/kinit, /usr/bin/aklog
     13Requires(post): systemd-units
     14Requires(preun): systemd-units
     15Requires(postun): systemd-units
     16BuildRequires: systemd-units
    1317
    1418%description
     
    1721Contains:
    1822 - A shell script for renewing the scripts AFS credentials <renew>
    19  - A crontab for calling the renew script <crontab>
     23 - A shell script for configuring scripts AFS <scripts-afsagent-startup>
     24 - systemd units for running the above
    2025See http://scripts.mit.edu/wiki for more information.
    2126
     
    2429
    2530%build
    26 ./configure --with-kinit=/usr/bin/kinit --with-aklog=/usr/bin/aklog
     31./configure --with-kinit=/usr/bin/kinit --with-aklog=/usr/bin/aklog --with-fs=/usr/bin/fs
    2732
    2833%install
    2934[ $RPM_BUILD_ROOT != / ] && rm -rf $RPM_BUILD_ROOT
    3035install -D renew $RPM_BUILD_ROOT/home/afsagent/renew
    31 install -D crontab $RPM_BUILD_ROOT/etc/cron.d/afsagent
     36install -D scripts-afsagent-startup $RPM_BUILD_ROOT/usr/local/libexec/scripts-afsagent-startup
     37install -D scripts-afsagent-startup.service $RPM_BUILD_ROOT%{_unitdir}/scripts-afsagent-startup.service
     38install -D scripts-afsagent.service $RPM_BUILD_ROOT%{_unitdir}/scripts-afsagent.service
     39install -D scripts-afsagent.timer $RPM_BUILD_ROOT%{_unitdir}/scripts-afsagent.timer
    3240
    3341%clean
     
    3543
    3644%files
    37 %defattr(0600, root, root)
    38 /etc/cron.d/afsagent
     45%defattr(0644,root,root)
     46%{_unitdir}/*.service
     47%{_unitdir}/*.timer
    3948%defattr(0755, afsagent, afsagent)
    4049/home/afsagent/renew
     50/usr/local/libexec/scripts-afsagent-startup
    4151
    4252%pre
     
    4454useradd -u 101 -g 101 afsagent || [ $? -eq 9 ]
    4555
     56%post
     57/bin/systemctl enable scripts-afsagent-startup.service >/dev/null 2>&1 || :
     58/bin/systemctl enable scripts-afsagent.service >/dev/null 2>&1 || :
     59/bin/systemctl enable scripts-afsagent.timer >/dev/null 2>&1 || :
     60
     61if [ $1 -eq 1 ] ; then
     62    # Initial installation
     63    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
     64fi
     65
     66%preun
     67if [ $1 -eq 0 ] ; then
     68    # Package removal, not upgrade
     69    /bin/systemctl --no-reload disable scripts-afsagent-startup.service > /dev/null 2>&1 || :
     70    /bin/systemctl --no-reload disable scripts-afsagent.service > /dev/null 2>&1 || :
     71    /bin/systemctl --no-reload disable scripts-afsagent.timer > /dev/null 2>&1 || :
     72    /bin/systemctl stop scripts-afsagent-startup.service > /dev/null 2>&1 || :
     73    /bin/systemctl stop scripts-afsagent.service > /dev/null 2>&1 || :
     74    /bin/systemctl stop scripts-afsagent.timer > /dev/null 2>&1 || :
     75fi
     76
    4677%postun
     78/bin/systemctl daemon-reload >/dev/null 2>&1 || :
     79if [ $1 -ge 1 ] ; then
     80    # Package upgrade, not uninstall
     81    /bin/systemctl try-restart scripts-afsagent.service >/dev/null 2>&1 || :
     82fi
     83
    4784if [ "$1" = "0" ] ; then
    4885   userdel -r afsagent
     
    5087
    5188%changelog
     89* Mon Nov 21 2011  Quentin Smith <quentin@mit.edu>
     90- add systemd units
     91- remove crontab
     92
    5293* Tue Aug 17 2010  Geoffrey Thomas <geofft@mit.edu>
    5394- aklog csail as well
Note: See TracChangeset for help on using the changeset viewer.