When systemd is installed sysstat always tries to install its service file directly to root to be able to enable it. This fails. The genrated code: if [ -x /usr/bin/systemctl -a -d "/usr/lib/systemd/system" ]; then \ install -m 644 sysstat.service /usr/lib/systemd/system; \ /usr/bin/systemctl enable sysstat.service; \ The result: /usr/bin/install: cannot create regular file ‘/usr/lib/systemd/system/sysstat.service’: Permission denied The quick fix? Install into DESTDIR and do not try to enable the service (which might not even be in place yet). I have attached a patch that does this (applies cleanly against upstrea git, with offset -1 against Gentoo. # emerge --info Portage 2.2.7 (hardened/linux/amd64, gcc-4.8.2, glibc-2.17, 3.12.6-gentoo x86_64) ================================================================= System uname: Linux-3.12.6-gentoo-x86_64-Intel-R-_Core-TM-_i7_CPU_920_@_2.67GHz-with-gentoo-2.2 KiB Mem: 18488676 total, 11399640 free KiB Swap: 12582336 total, 12453936 free Timestamp of tree: Fri, 03 Jan 2014 00:30:01 +0000 ld GNU ld (GNU Binutils) 2.24 app-shells/bash: 4.2_p45 dev-java/java-config: 2.2.0 dev-lang/python: 2.7.6, 3.2.5-r3, 3.3.3 dev-util/cmake: 2.8.12.1-r2 dev-util/pkgconfig: 0.28 sys-apps/baselayout: 2.2 sys-apps/openrc: 0.12.4 sys-apps/sandbox: 2.6-r1 sys-devel/autoconf: 2.13, 2.69 sys-devel/automake: 1.10.3, 1.11.6, 1.12.6, 1.13.4, 1.14.1 sys-devel/binutils: 2.24 sys-devel/gcc: 4.8.2 sys-devel/gcc-config: 1.8 sys-devel/libtool: 2.4.2 sys-devel/make: 4.0-r1 sys-kernel/linux-headers: 3.12 (virtual/os-headers) sys-libs/glibc: 2.17 Repositories: gentoo gnome steam-overlay x11 Mine ACCEPT_KEYWORDS="amd64 ~amd64" ACCEPT_LICENSE="* -@EULA" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=native -O2 -pipe -ggdb" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" CXXFLAGS="-march=native -O2 -pipe -ggdb" DISTDIR="/var/portage/distfiles" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-logs clean-logs config-protect-if-modified distlocks ebuild-locks fail-clean fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="http://distfiles.gentoo.org" LANG="sv_SE.utf8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" MAKEOPTS="-j8" PKGDIR="/var/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/var/portage" PORTDIR_OVERLAY="/var/lib/layman/gnome /var/lib/layman/steam /var/lib/layman/x11 /var/overlays/mine" USE="X a52 aac acl ads alsa amd64 apng archive avahi bash-completion berkdb bluetooth branding btrfs bzip2 cairo caps cdda cddb cdr cli colord cracklib cron crypt cups cxx dbus device-mapper dri dts dvd eds exif fat ffmpeg firewalld flac fortran ftp gbm gdbm gdu geoclue geoip gif gnome gnome-keyring gnome-online-accounts gssapi gstreamer gtk gtk3 gudev hardened hfs highlight hpijs hwdb iconv icq icu idn introspection ipv6 isag ivorbis jabber jit joystick jpeg jpeg2k justify kdrive kerberos keymap lcms ldap libass libnotify libsamplerate libsecret lm_sensors lto lvm lzma mad mdadm mmx mmxext mng modemmanager modules mp3 mpeg msn mtp mudflap multilib mysql nautilus ncurses netlink networkmanager nfs nfsidmap nfsv41 nls nptl ntfs numa offensive ogg opengl openmp openvg optimization opus orc pam pango parted pcap pcre pdf png pnm policykit pulseaudio qemu qt3support readline realtime sasl sdl sendto session smp smpeg socialweb spell spice sqlite sse sse2 sse3 sse4 sse4_1 ssh ssl ssse3 startup-notification steamruntime sudo svg systemd tcpd telepathy theora threads tiff tracker truetype udev udisks unicode urandom usb usbredir vcd vdpau vim-syntax virt-network vorbis wayland x264 xattr xcb xkb xlib-xcb xml xmp xmpp xps xrandr xv xvid xvmc xwayland zeroconf zlib" ABI_X86="32 64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CURL_SSL="nss" DRACUT_MODULES="btrfs caps syslog systemd" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="sv sv_SE en" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" QEMU_SOFTMMU_TARGETS="x86_64 i386" RUBY_TARGETS="ruby19 ruby18" USERLAND="GNU" VIDEO_CARDS="nouveau" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, SYNC, USE_PYTHON
Created attachment 366822 [details, diff] Patch to install service file into destdir and remove enableing during "make install"
Created attachment 366824 [details] Build log without patch
Fixed without a revision bump. Thanks for the patch!
Created attachment 366978 [details, diff] 0001-Fix-install-with-systemd.patch Sorry, I realized the patch I gave you was invalid, it installs the file sysstat.service AS $(DESTDIR)$(SYSTEMD_UNIT_DIR), not into it. So a working patch is actually something more like the following.
Um, that's in the tree now replacing the previous patch. Please close this bug report as FIXED when you have again tested the new patch.
Now it works correctly. Thanks!