FAQ Search Today's Posts Mark Forums Read

» Linux Archive
Home
New Posts
Search
FAQ


Go Back   Linux Archive > Redhat > Fedora SELinux Support

 
 
LinkBack Thread Tools
 
Old 07-08-2008, 08:51 PM
Johnny Tan
 
Default rsyncd can't open log file, but there are no avc messages

Paul Howarth wrote:

On Tue, 08 Jul 2008 16:36:13 -0400
Johnny Tan <linuxweb@gmail.com> wrote:


Paul Howarth wrote:

On Mon, 07 Jul 2008 13:01:55 -0400
Johnny Tan <linuxweb@gmail.com> wrote:


Johnny Tan wrote:

I'm stumped.

I run a Java app called Solr, which does search indexing. My solr
server creates the index, then I have a bunch of solr clients that
rsync that index over.

The rsync itself is fine, that works. The problem is it won't
write to the appropriate logfile, which is:
/opt/solr/logs/rsyncd.log

/opt/solr/logs is a symlink to /var/log/store.

A little bit more information that might help solve this...

If I remove the symlink, and /opt/solr/bin/rsyncd-start runs
(which basically starts rsyncd), then rsyncd can write to
/opt/solr/logs/rsyncd.log with no problems.


If I put the symlink back in (to /var/log/store), then it
fails (again, with no AVC messages).


The only difference I can see between /opt/solr/logs (as a
directory) and /var/log/store is the default contexts, for
/opt/solr/logs, it's rootbject_r:usr_t, for /var/log/store
it's rootbject_r:var_log_t


When I put the symlink back, I tried changing the context of
/var/log/store to rootbject_r:usr_t to match
/opt/solr/logs, but that doesn't seem to make a difference.


Max, a list member, suggested offline that it might have to
do with type_transition, which does seem to make sense.


I tried both:
type_transition rsync_t var_log_t : file rsync_log_t;
and
type_transition rsync_t var_log_t : file usr_t;

But neither worked (I have all the appropriate allows for
those contexts).



Am I going down the right path here (type_transition)? Or
does anyone else have a suggestion in terms of how the
symlink can be used?


Can you try this policy module:

::::::::::::::
solr.fc
::::::::::::::
/var/log/store(/.*)? gen_context(system_ubject_r:rsync_log_t,s0)

==

# semanage fcontext -a -t rsync_log_t "/var/log/store(/.*)?"
libsepol.context_from_record: type rsync_log_t is not defined
libsepol.context_from_record: could not create context structure
libsemanage.validate_handler: invalid context
system_ubject_r:rsync_log_t:s0 specified for
/var/log/store(/.*)? [all files]

libsemanage.dbase_llist_iterate: could not iterate over records
/usr/sbin/semanage: Could not add file context for
/var/log/store(/.*)?


==

It seems rsync_log_t is not defined. Can I somehow do this
without having rsync_log_t?


It works fine when I don't use a symlink, so I assume
rsync_log_t is not necessary for this to work.


But I need the symlink because I need the files to be stored
in /var/log/store, as opposed to /opt/solr/logs.


I thought from earlier messages you were on RHEL 5? I've tested this
module with CentOS 5.2 and it loads just fine.

Which policy version are you using?


selinux-policy-2.4.6-106.el5_1.3

I haven't updated yet to 5.2

johnn

--
fedora-selinux-list mailing list
fedora-selinux-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-selinux-list
 
Old 07-08-2008, 09:01 PM
Paul Howarth
 
Default rsyncd can't open log file, but there are no avc messages

On Tue, 08 Jul 2008 16:51:24 -0400
Johnny Tan <linuxweb@gmail.com> wrote:

> Paul Howarth wrote:
> > On Tue, 08 Jul 2008 16:36:13 -0400
> > Johnny Tan <linuxweb@gmail.com> wrote:
> >
> >> Paul Howarth wrote:
> >>> On Mon, 07 Jul 2008 13:01:55 -0400
> >>> Johnny Tan <linuxweb@gmail.com> wrote:
> >>>
> >>>> Johnny Tan wrote:
> >>>>> I'm stumped.
> >>>>>
> >>>>> I run a Java app called Solr, which does search indexing. My
> >>>>> solr server creates the index, then I have a bunch of solr
> >>>>> clients that rsync that index over.
> >>>>>
> >>>>> The rsync itself is fine, that works. The problem is it won't
> >>>>> write to the appropriate logfile, which is:
> >>>>> /opt/solr/logs/rsyncd.log
> >>>>>
> >>>>> /opt/solr/logs is a symlink to /var/log/store.
> >>>> A little bit more information that might help solve this...
> >>>>
> >>>> If I remove the symlink, and /opt/solr/bin/rsyncd-start runs
> >>>> (which basically starts rsyncd), then rsyncd can write to
> >>>> /opt/solr/logs/rsyncd.log with no problems.
> >>>>
> >>>> If I put the symlink back in (to /var/log/store), then it
> >>>> fails (again, with no AVC messages).
> >>>>
> >>>> The only difference I can see between /opt/solr/logs (as a
> >>>> directory) and /var/log/store is the default contexts, for
> >>>> /opt/solr/logs, it's rootbject_r:usr_t, for /var/log/store
> >>>> it's rootbject_r:var_log_t
> >>>>
> >>>> When I put the symlink back, I tried changing the context of
> >>>> /var/log/store to rootbject_r:usr_t to match
> >>>> /opt/solr/logs, but that doesn't seem to make a difference.
> >>>>
> >>>> Max, a list member, suggested offline that it might have to
> >>>> do with type_transition, which does seem to make sense.
> >>>>
> >>>> I tried both:
> >>>> type_transition rsync_t var_log_t : file rsync_log_t;
> >>>> and
> >>>> type_transition rsync_t var_log_t : file usr_t;
> >>>>
> >>>> But neither worked (I have all the appropriate allows for
> >>>> those contexts).
> >>>>
> >>>>
> >>>> Am I going down the right path here (type_transition)? Or
> >>>> does anyone else have a suggestion in terms of how the
> >>>> symlink can be used?
> >>>
> >>> Can you try this policy module:
> >>>
> >>> ::::::::::::::
> >>> solr.fc
> >>> ::::::::::::::
> >>> /var/log/store(/.*)? gen_context(system_ubject_r:rsync_log_t,s0)
> >> ==
> >>
> >> # semanage fcontext -a -t rsync_log_t "/var/log/store(/.*)?"
> >> libsepol.context_from_record: type rsync_log_t is not defined
> >> libsepol.context_from_record: could not create context structure
> >> libsemanage.validate_handler: invalid context
> >> system_ubject_r:rsync_log_t:s0 specified for
> >> /var/log/store(/.*)? [all files]
> >> libsemanage.dbase_llist_iterate: could not iterate over records
> >> /usr/sbin/semanage: Could not add file context for
> >> /var/log/store(/.*)?
> >>
> >> ==
> >>
> >> It seems rsync_log_t is not defined. Can I somehow do this
> >> without having rsync_log_t?
> >>
> >> It works fine when I don't use a symlink, so I assume
> >> rsync_log_t is not necessary for this to work.
> >>
> >> But I need the symlink because I need the files to be stored
> >> in /var/log/store, as opposed to /opt/solr/logs.
> >
> > I thought from earlier messages you were on RHEL 5? I've tested this
> > module with CentOS 5.2 and it loads just fine.
> >
> > Which policy version are you using?
>
> selinux-policy-2.4.6-106.el5_1.3
>
> I haven't updated yet to 5.2

Try adding the type definition to the top of the policy module (just
after the "policy_module" line):

type rsync_log_t;
logging_log_file(rsync_log_t)

Paul.


>
> johnn
>

--
fedora-selinux-list mailing list
fedora-selinux-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-selinux-list
 
Old 07-08-2008, 09:57 PM
Johnny Tan
 
Default rsyncd can't open log file, but there are no avc messages

Paul Howarth wrote:
It seems rsync_log_t is not defined. Can I somehow do this
without having rsync_log_t?


It works fine when I don't use a symlink, so I assume
rsync_log_t is not necessary for this to work.


But I need the symlink because I need the files to be stored
in /var/log/store, as opposed to /opt/solr/logs.

I thought from earlier messages you were on RHEL 5? I've tested this
module with CentOS 5.2 and it loads just fine.

Which policy version are you using?

selinux-policy-2.4.6-106.el5_1.3

I haven't updated yet to 5.2


Try adding the type definition to the top of the policy module (just
after the "policy_module" line):

type rsync_log_t;
logging_log_file(rsync_log_t)


That still didn't recognize rsync_log_t. But I went ahead
and upgraded to 5.2, and my original selinux policy works --
it doesn't use rsync_log_t at all.


My (completely wild) guess is that something with symlinks
("class lnk_file") got fixed in the new policy, but I don't
know what.


Thanks for the help though!

johnn

--
fedora-selinux-list mailing list
fedora-selinux-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-selinux-list
 
Old 07-08-2008, 10:16 PM
Johnny Tan
 
Default rsyncd can't open log file, but there are no avc messages

Johnny Tan wrote:

Paul Howarth wrote:
It seems rsync_log_t is not defined. Can I somehow do this without
having rsync_log_t?


It works fine when I don't use a symlink, so I assume rsync_log_t
is not necessary for this to work.


But I need the symlink because I need the files to be stored in
/var/log/store, as opposed to /opt/solr/logs.

I thought from earlier messages you were on RHEL 5? I've tested this
module with CentOS 5.2 and it loads just fine.

Which policy version are you using?

selinux-policy-2.4.6-106.el5_1.3

I haven't updated yet to 5.2


Try adding the type definition to the top of the policy module (just
after the "policy_module" line):

type rsync_log_t;
logging_log_file(rsync_log_t)


That still didn't recognize rsync_log_t. But I went ahead and upgraded
to 5.2, and my original selinux policy works -- it doesn't use
rsync_log_t at all.


Question:

Is it ok to update ONLY selinux-policy to the version that
comes with 5.2 (and library, etc., dependencies) WITHOUT
upgrading the kernel and everything else to their 5.2 versions?


johnn

--
fedora-selinux-list mailing list
fedora-selinux-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-selinux-list
 
Old 07-09-2008, 12:17 AM
Chuck Anderson
 
Default rsyncd can't open log file, but there are no avc messages

On Tue, Jul 08, 2008 at 05:57:48PM -0400, Johnny Tan wrote:
> My (completely wild) guess is that something with symlinks ("class
> lnk_file") got fixed in the new policy, but I don't know what.

symlinks + SELinux are difficult to deal with. It is MUCH easier to
just use bind mounts:

mount --bind /opt/solr/logs /var/log/store

in /etc/fstab:

/opt/solr/logs /var/log/store none bind 0 0

--
fedora-selinux-list mailing list
fedora-selinux-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-selinux-list
 
Old 07-09-2008, 01:50 PM
Daniel J Walsh
 
Default rsyncd can't open log file, but there are no avc messages

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Johnny Tan wrote:
| Johnny Tan wrote:
|> Paul Howarth wrote:
|>>>>> It seems rsync_log_t is not defined. Can I somehow do this without
|>>>>> having rsync_log_t?
|>>>>>
|>>>>> It works fine when I don't use a symlink, so I assume rsync_log_t
|>>>>> is not necessary for this to work.
|>>>>>
|>>>>> But I need the symlink because I need the files to be stored in
|>>>>> /var/log/store, as opposed to /opt/solr/logs.
|>>>> I thought from earlier messages you were on RHEL 5? I've tested this
|>>>> module with CentOS 5.2 and it loads just fine.
|>>>>
|>>>> Which policy version are you using?
|>>> selinux-policy-2.4.6-106.el5_1.3
|>>>
|>>> I haven't updated yet to 5.2
|>>
|>> Try adding the type definition to the top of the policy module (just
|>> after the "policy_module" line):
|>>
|>> type rsync_log_t;
|>> logging_log_file(rsync_log_t)
|>
|> That still didn't recognize rsync_log_t. But I went ahead and upgraded
|> to 5.2, and my original selinux policy works -- it doesn't use
|> rsync_log_t at all.
|
| Question:
|
| Is it ok to update ONLY selinux-policy to the version that comes with
| 5.2 (and library, etc., dependencies) WITHOUT upgrading the kernel and
| everything else to their 5.2 versions?
|
Yes
| johnn
|
| --
| fedora-selinux-list mailing list
| fedora-selinux-list@redhat.com
| https://www.redhat.com/mailman/listinfo/fedora-selinux-list

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iEYEARECAAYFAkh0wjkACgkQrlYvE4MpobOMlgCgg4t9GiG/3YDOTliINaaOuXMa
gxIAn079tVvoEgMLQXmK2fxMfckroMEZ
=y1mH
-----END PGP SIGNATURE-----

--
fedora-selinux-list mailing list
fedora-selinux-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-selinux-list
 

Thread Tools




All times are GMT. The time now is 11:56 PM.

VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org