1. Summary
  2. Files
  3. Support
  4. Report Spam
  5. Create account
  6. Log in

Changeset 3356

Show
Ignore:
Timestamp:
06/06/11 18:37:53 (2 years ago)
Author:
chrfranke
Message:

Re-enable '--with-initscriptdir=auto' as default.
Change search for initddir and systemdsystemunitdir such that
default ./configure does never overwrite system files.

Location:
trunk/smartmontools
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/smartmontools/CHANGELOG

    r3355 r3356  
    4141<DEVELOPERS: ADDITIONS TO THE CHANGE LOG GO JUST BELOW HERE, PLEASE> 
    4242 
     43  [CF] Re-enable '--with-initscriptdir=auto' as default. 
     44       Change search for initddir and systemdsystemunitdir such that 
     45       default ./configure does never overwrite system files. 
     46 
    4347  [MS] drivedb.h update: 
    4448       disentangle Transcend SSD versions 
  • trunk/smartmontools/INSTALL

    r3352 r3356  
    689689                                                                  Contents of smartd/smartd.conf man pages; 
    690690                                                                  Directory for rc.d/init.d/smartd init script 
    691 --with-initscriptdir  no                                          Location of init scripts, use "auto" to autodetect 
     691--with-initscriptdir           auto                               Location of init scripts 
    692692--with-systemdsystemunitdir    auto                               Location of systemd service files 
    693693--with-docdir         ${prefix}/share/doc/smartmontools           Location of the documentation 
     
    713713new --docdir option added in autoconf 2.60. 
    714714 
     715The defaults for --with-initscriptdir and --with-systemdsystemunitdir are 
     716guessed such that the following rules apply: 
     717- If --prefix=/usr --sysconfdir=/etc is specified, the guessed directories 
     718  should be the defaults used by the current OS or distribution. 
     719- If --sysconfdir=/etc is NOT specified, the guessed directories should 
     720  always be below ${prefix} or below ${sysconfdir}. 
     721 
    715722Here's an example: 
    716723If you set --prefix=/home/joe and none of the other four 
    717724variables then the different directories that are used would be: 
    718725--sbindir             /home/joe/sbin 
     726--docdir              /home/joe/share/doc/smartmontools 
    719727--mandir              /home/joe/share/man 
    720728--sysconfdir          /home/joe/etc 
    721 --with-initscriptdir  [disabled] 
    722 --with-docdir         /home/joe/doc/smartmontools 
     729--with-exampledir     /home/joe/share/doc/smartmontools/examplescripts 
     730--with-drivedbdir     /home/joe/share/smartmontools 
     731--with-initscriptdir         [see below] 
     732--with-systemdsystemunitdir  [see below] 
     733 
     734If systemd is present (and pkg-config reports /lib/systemd/system 
     735as the systemdsystemunitdir): 
     736 
     737--with-initscriptdir         [disabled] 
     738--with-systemdsystemunitdir  /home/joe/lib/systemd/system 
     739 
     740else if /etc/rc.d/init.d exists: 
     741 
     742--with-initscriptdir         /home/joe/etc/rc.d/init.d 
     743--with-systemdsystemunitdir  [disabled] 
     744 
     745else if /etc/init.d exists: 
     746 
     747--with-initscriptdir         /home/joe/etc/init.d 
     748--with-systemdsystemunitdir  [disabled] 
     749 
     750else if /etc/rc.d exists: 
     751 
     752--with-initscriptdir         /home/joe/etc/rc.d 
     753--with-systemdsystemunitdir  [disabled] 
     754 
     755else 
     756 
     757--with-initscriptdir         [disabled] 
     758--with-systemdsystemunitdir  [disabled] 
    723759 
    724760This is useful for test installs in a harmless subdirectory somewhere. 
  • trunk/smartmontools/configure.in

    r3352 r3356  
    174174 auto|yes) 
    175175   test -n "$PKG_CONFIG" && systemdsystemunitdir=`$PKG_CONFIG --variable=systemdsystemunitdir systemd` 
    176    if test "$with_systemdsystemunitdir" = "yes" && test -z "$systemdsystemunitdir"; then 
    177      AC_MSG_ERROR([Location of systemd service files not found]) 
    178    fi ;; 
     176   case "$with_systemdsystemunitdir:$sysconfdir:$systemdsystemunitdir" in 
     177     yes:*:) AC_MSG_ERROR([Location of systemd service files not found]) ;; 
     178     yes:*:*|auto:*:|auto:/etc:*) ;; 
     179     *) systemdsystemunitdir='${prefix}'$systemdsystemunitdir ;; 
     180   esac ;; 
    179181 no) ;; 
    180182 *) systemdsystemunitdir="$with_systemdsystemunitdir" ;; 
     
    184186 
    185187AC_ARG_WITH(initscriptdir, 
    186   [AC_HELP_STRING([--with-initscriptdir=DIR],[Location of the init script])], 
    187   [], [with_initscriptdir=no]) 
     188  [AC_HELP_STRING([--with-initscriptdir@<:@=DIR|auto|yes|no@:>@], [Location of init scripts [auto]])], 
     189  [], [with_initscriptdir=auto]) 
    188190 
    189191AC_MSG_CHECKING(which init (rc) directory to use) 
    190192initddir="" 
    191 for initdir in /etc/init.d /etc/rc.d/init.d /sbin/init.d        \ 
    192          /usr/local/etc/rc.d /etc/rc.d 
    193 do 
    194   if 
    195     test -d $initdir 
    196   then 
    197     initddir=$initdir 
     193for dir in rc.d/init.d init.d rc.d; do 
     194  if test -d /etc/$dir; then 
     195    initddir='${sysconfdir}'/$dir 
    198196    break 
    199197  fi 
     
    203201case "$with_initscriptdir" in 
    204202  auto) test -n "$systemdsystemunitdir" && initddir= ;; 
    205   yes) ;; 
     203  yes) 
     204   if test -z "$initddir"; then 
     205     AC_MSG_ERROR([Location of init scripts not found]) 
     206   fi ;; 
    206207  no) initddir= ;; 
    207208  *) initddir="$with_initscriptdir" ;;