Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 26658

Summary: sys-apps/syslog-ng chroot
Product: Gentoo Linux Reporter: Paul Belt <gaarde>
Component: New packagesAssignee: Mr. Bones. (RETIRED) <mr_bones_>
Status: RESOLVED WONTFIX    
Severity: minor CC: hardened
Priority: High    
Version: 1.0   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: updated files to allow easy chroot

Description Paul Belt 2003-08-14 20:40:39 UTC
Add these to the portage tree please.  See attachment.

Simply put... allows users to easily use syslog-ng in a chroot and run-as.
Might need to modify pkg_config() to copy the files listed below into the chroot.

/lib/libnsl.so
/lib/libresolv.so

Reproducible: Always
Steps to Reproduce:
1.
2.
3.

Actual Results:  
It works perfectly, except the user syslogng needs to get created at some point
before an `ebuild syslog-ng-1.6.0_rc3-r1.ebuild config`

Expected Results:  
Some 'ambitious' gentoo developer will insert an adduser command into the ebuild
foo config and commit this to the CVS

I forgot to update the Changelog... so here's my proposed entry... ready for
copy-paste:

--- BEGIN CUT ---
*syslog-ng-1.6.0_rc3-r1 (14 Aug 2003)

  14 Aug 2003; Paul Belt <gaarde@yahoo.com>
  syslog-ng-1.6.0_rc3-r1.ebuild:
  added pkg_config() to create chroot

  conf.d/syslog-ng
  created to allow user setting of chroot dir and run-as user

  init.d/syslog-ng
  updated to allow for chroot and run-as start-up directives

--- END CUT ---
Comment 1 Paul Belt 2003-08-14 20:42:37 UTC
Created attachment 16122 [details]
updated files to allow easy chroot

Contains:
  etc/conf.d/syslog-ng
  etc/init.d/syslog-ng
  syslog-ng-1.6.0_rc3-r1.ebuild.patch
  syslog-ng.init.patch
  usr/local/portage/sys-apps/syslog-ng/syslog-ng-1.6.0_rc3-r1.ebuild
Comment 2 solar (RETIRED) gentoo-dev 2003-08-18 13:01:57 UTC
my $0.02

Reading up on the chroot option of syslog-ng
well the manpage itself shows little to nothing about the -C option
other than [ -C <chroot-dir> ] which does not exactly tell me/us if this option is the equiv of the sysklogd -a option.

Also correct me if I'm wrong but would we not have to mount --bind /proc ${CHROOT}/proc in order for syslog-ng to be able to read from /proc/kmsg ?

And something like
stop {
  mnt="$(mount | grep ${CHROOT}/proc | awk '{print $3}')"
  [ "$mnt" == "${CHROOT}/proc" ] && umount ${CHROOT}/proc 2> /dev/null || eerror "Unmounting proc filesystem at $mnt"
}

Chrooting is is a good idea, but without proper documentation the option is little to no use. I would personally expect a chroot option for syslong-ng to be able to be the syslog for all the other chrooted environments.

Also noteworthy in pkg_config() we should never copy a binary file right off the root file system such as /lib/lib*.so. Instead the syslog-ng should be built with a "static" option so the libraries will be linked into the binary by default thus avoiding clutter in the chroot env.
Comment 3 Mr. Bones. (RETIRED) gentoo-dev 2004-06-22 12:05:07 UTC
syslog-ng-1.6.4 has been marked stable on x86 and now includes USE=static support.
Comment 4 Mr. Bones. (RETIRED) gentoo-dev 2004-09-24 17:14:38 UTC
Forgot to mark this.