[CentOS] Network Performance Update

2018-05-04 Thread Chris Olson
My thanks to all that responded to my posting about measuring
network performance.  Helpful suggestions are always very much
appreciated.  The type of testing that we were attempting does
not appear to be a major topic of interest on the list but the
additional information below may be helpful to some users.

Initial reports of an issue with |dd not being recognized was
questioned so several more tests were conducted.  Testing the
transfer to /dev/null was repeated several times with identical
results as indicated immediately below.  How this message about
dd was interpreted as it not being recognized is not clear.

What is clear is the Broken pipe indication which we then went
on to investigate.  All indications are that the destination
of the pipe was not accepting the sourced data.  With this in
mind we conducted several successful transfers as indicated
below.  It appears that /dev/null is not a legitimate place
to send data from an ftp transfer.  This was the case even
when the original source was a file and not a dd command.

One of the suggestions in response to our original posting
indicated that "|dd might be changed to |"dd.  This was also
tried as indicated below.  Both forms of the put command that
send the data to an actual file (zeros) work and were repeated
several times.  Using the form |"dd consistently runs slower
than using the original put command format: "|dd

Bottom Line: Mystery partially solved. What is left is why the
/dev/null destination for the data does not work.  Just about
every other commands we tried routing data to /dev/null work
from any user space.

Attempting Transfer Of dd Created Output To /dev/null
-
ftp>
ftp> put "|dd if=/dev/zero bs=32768 count=8000" /dev/null
local: |dd if=/dev/zero bs=32768 count=8000 remote: /dev/null
227 Entering Passive Mode (192,168,1,101,27,154)
500 OOPS: ftruncate
dd: writing `standard output': Broken pipe
1+0 records in
0+0 records out
0 bytes (0 B) copied, 9.3018e-05 s, 0.0 kB/s
ftp> 


Successful Transfers Of dd Created Output To A File Named zeros
---
ftp>
ftp> put "|dd if=/dev/zero bs=32768 count=8000" zeros
local: |dd if=/dev/zero bs=32768 count=8000 remote: zeros
227 Entering Passive Mode (192,168,1,103,164,178)
150 Ok to send data.
8000+0 records in
8000+0 records out
262144000 bytes (262 MB) copied, 26.4611 s, 9.9 MB/s
226 Transfer complete.
262144000 bytes sent in 27 seconds (9.7e+03 Kbytes/s)
ftp>


ftp> 
ftp> put |"dd if=/dev/zero bs=32768 count=8000" zeros
local: |dd if=/dev/zero bs=32768 count=8000 remote: zeros
227 Entering Passive Mode (192,168,1,103,39,252)
150 Ok to send data.
8000+0 records in
8000+0 records out
262144000 bytes (262 MB) copied, 30.7971 s, 8.5 MB/s
226 Transfer complete.
262144000 bytes sent in 31 seconds (8.3e+03 Kbytes/s)
ftp> 

___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


[CentOS] Samba HOWTO wiki bug: chcon samba_share_t

2018-05-04 Thread Warren Young
In this wiki article:

   https://wiki.centos.org/HowTos/SetUpSamba

…there is a command down in section 2 that gives an error here on CentOS 7:

$ sudo semanage fcontext –at samba_share_t /path/to/share
…noise noise noise… 
semanage: error: unrecognized arguments: samba_share_t /path/to/share

That and the following restorecon command can be replaced by a single shorter 
command, which also fixes the symptom:

$ sudo chcon -R -t samba_share_t /path/to/share
___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Samba HOWTO wiki bug: chcon samba_share_t

2018-05-04 Thread Akemi Yagi
On Fri, May 4, 2018 at 12:03 PM, Warren Young  wrote:
> In this wiki article:
>
>https://wiki.centos.org/HowTos/SetUpSamba
>
> …there is a command down in section 2 that gives an error here on CentOS 7:
>
> $ sudo semanage fcontext –at samba_share_t /path/to/share
> …noise noise noise…
> semanage: error: unrecognized arguments: samba_share_t /path/to/share
>
> That and the following restorecon command can be replaced by a single shorter 
> command, which also fixes the symptom:
>
> $ sudo chcon -R -t samba_share_t /path/to/share

Updated the page as suggested. Thanks.

Akemi
___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Samba HOWTO wiki bug: chcon samba_share_t

2018-05-04 Thread Warren Young
On May 4, 2018, at 3:03 PM, Akemi Yagi  wrote:
> 
> On Fri, May 4, 2018 at 12:03 PM, Warren Young  wrote:
>> 
>>$ sudo chcon -R -t samba_share_t /path/to/share
> 
> Updated the page as suggested. Thanks.

Thanks!

I now see another instance of this in section 3.  Instead of copying the text 
verbatim, it should probably be:

chcon -R -t samba_share_t /mnt/data

…in order to match the text above it.
___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Samba HOWTO wiki bug: chcon samba_share_t

2018-05-04 Thread Akemi Yagi
On Fri, May 4, 2018 at 2:26 PM, Warren Young  wrote:
> On May 4, 2018, at 3:03 PM, Akemi Yagi  wrote:
>>
>> On Fri, May 4, 2018 at 12:03 PM, Warren Young  wrote:
>>>
>>>$ sudo chcon -R -t samba_share_t /path/to/share
>>
>> Updated the page as suggested. Thanks.
>
> Thanks!
>
> I now see another instance of this in section 3.  Instead of copying the text 
> verbatim, it should probably be:
>
> chcon -R -t samba_share_t /mnt/data
>
> …in order to match the text above it.

Warren,

I was just informed that the chcon command your suggested was
originally there, but it was replaced with the 2 line version sometime
ago. The reason given was "Replace chcon by semanage/restorecon pair
to survive filesystem relabel".

What do you think?

Akemi
___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Samba HOWTO wiki bug: chcon samba_share_t

2018-05-04 Thread Louis Lagendijk
On Fri, 2018-05-04 at 14:55 -0700, Akemi Yagi wrote:
> On Fri, May 4, 2018 at 2:26 PM, Warren Young 
> wrote:
> > On May 4, 2018, at 3:03 PM, Akemi Yagi  wrote:
> > > 
> > > On Fri, May 4, 2018 at 12:03 PM, Warren Young  > > > wrote:
> > > > 
> > > >$ sudo chcon -R -t samba_share_t /path/to/share
> > > 
> > > Updated the page as suggested. Thanks.
> > 
> > Thanks!
> > 
> > I now see another instance of this in section 3.  Instead of
> > copying the text verbatim, it should probably be:
> > 
> > chcon -R -t samba_share_t /mnt/data
> > 
> > …in order to match the text above it.
> 
> Warren,
> 
> I was just informed that the chcon command your suggested was
> originally there, but it was replaced with the 2 line version
> sometime
> ago. The reason given was "Replace chcon by semanage/restorecon pair
> to survive filesystem relabel".

The comment is correct: chcon will not survive a relabel. You need to
update the database first (semanage fcontext) and then let a relabel
apply the new context.

Louis
___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Samba HOWTO wiki bug: chcon samba_share_t

2018-05-04 Thread Akemi Yagi
On Fri, May 4, 2018 at 3:11 PM, Louis Lagendijk  wrote:
> On Fri, 2018-05-04 at 14:55 -0700, Akemi Yagi wrote:
>> On Fri, May 4, 2018 at 2:26 PM, Warren Young 
>> wrote:
>> > On May 4, 2018, at 3:03 PM, Akemi Yagi  wrote:
>> > >
>> > > On Fri, May 4, 2018 at 12:03 PM, Warren Young > > > > wrote:
>> > > >
>> > > >$ sudo chcon -R -t samba_share_t /path/to/share
>> > >
>> > > Updated the page as suggested. Thanks.
>> >
>> > Thanks!
>> >
>> > I now see another instance of this in section 3.  Instead of
>> > copying the text verbatim, it should probably be:
>> >
>> > chcon -R -t samba_share_t /mnt/data
>> >
>> > …in order to match the text above it.
>>
>> Warren,
>>
>> I was just informed that the chcon command your suggested was
>> originally there, but it was replaced with the 2 line version
>> sometime
>> ago. The reason given was "Replace chcon by semanage/restorecon pair
>> to survive filesystem relabel".
>
> The comment is correct: chcon will not survive a relabel. You need to
> update the database first (semanage fcontext) and then let a relabel
> apply the new context.
>
> Louis

Thanks for the input. Reverted the change.

Akemi
___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Samba HOWTO wiki bug: chcon samba_share_t

2018-05-04 Thread Warren Young
On May 4, 2018, at 4:11 PM, Louis Lagendijk  wrote:
> 
> The comment is correct: chcon will not survive a relabel. You need to
> update the database first (semanage fcontext) and then let a relabel
> apply the new context.

Alright, then why do I get that error when I give the command from this 
morning’s wiki text, and how do I avoid it?
___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Samba HOWTO wiki bug: chcon samba_share_t

2018-05-04 Thread Gordon Messmer

On 05/04/2018 12:03 PM, Warren Young wrote:

…there is a command down in section 2 that gives an error here on CentOS 7:

 $ sudo semanage fcontext –at samba_share_t /path/to/share
 …noise noise noise…
 semanage: error: unrecognized arguments: samba_share_t /path/to/share


What is "noise" exactly?  I don't get errors from that command:

# semanage fcontext -at samba_share_t /srv/samba
#


That and the following restorecon command can be replaced by a single shorter 
command, which also fixes the symptom:


As others pointed out, chcon is not a replacement for registering a 
persistent file context.

___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Samba HOWTO wiki bug: chcon samba_share_t

2018-05-04 Thread Warren Young
On May 4, 2018, at 5:13 PM, Gordon Messmer  wrote:
> 
> On 05/04/2018 12:03 PM, Warren Young wrote:
>> …there is a command down in section 2 that gives an error here on CentOS 7:
>> 
>> $ sudo semanage fcontext –at samba_share_t /path/to/share
>> …noise noise noise…
>> semanage: error: unrecognized arguments: samba_share_t /path/to/share
> 
> What is "noise" exactly?  I don't get errors from that command:

The full message is:

usage: semanage [-h]


{import,export,login,user,port,interface,module,node,fcontext,boolean,permissive,dontaudit}
...
semanage: error: unrecognized arguments: samba_share_t 
'/path/to/share(/.*)?'
___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Samba HOWTO wiki bug: chcon samba_share_t

2018-05-04 Thread Earl A Ramirez
On 4 May 2018 at 19:49, Warren Young  wrote:

> On May 4, 2018, at 5:13 PM, Gordon Messmer 
> wrote:
> >
> > On 05/04/2018 12:03 PM, Warren Young wrote:
> >> …there is a command down in section 2 that gives an error here on
> CentOS 7:
> >>
> >> $ sudo semanage fcontext –at samba_share_t /path/to/share
> >> …noise noise noise…
> >> semanage: error: unrecognized arguments: samba_share_t
> /path/to/share
> >
> > What is "noise" exactly?  I don't get errors from that command:
>
> The full message is:
>
> usage: semanage [-h]
>
> {import,export,login,user,port,interface,module,node,
> fcontext,boolean,permissive,dontaudit}
> ...
> semanage: error: unrecognized arguments: samba_share_t
> '/path/to/share(/.*)?'


You can check the labels using seinfo -t, below is what I had for samba

   samba_etc_t
   samba_initrc_exec_t
   samba_log_t
   samba_net_exec_t
   samba_net_t
   samba_net_tmp_t
   samba_secrets_t
   samba_share_t
   samba_spool_t
   samba_unconfined_net_t
   samba_unconfined_script_exec_t
   samba_unconfined_script_t
   samba_unit_file_t
   samba_var_t
   sambagui_exec_t
   sambagui_t

I tried a few boxes and I don't get that error




-- 
Kind Regards
Earl Ramirez
___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Samba HOWTO wiki bug: chcon samba_share_t

2018-05-04 Thread Warren Young
On May 4, 2018, at 6:35 PM, Earl A Ramirez  wrote:
> 
> You can check the labels using seinfo -t, below is what I had for samba

I’m away from work now, so I can’t check it at the moment, but if that 
explained the problem, wouldn’t my chcon command also have failed?  Clearly the 
SELinux type samba_share_t does exist on my CentOS 7 machine.
___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Samba HOWTO wiki bug: chcon samba_share_t

2018-05-04 Thread Gordon Messmer

On 05/04/2018 04:05 PM, Warren Young wrote:

On May 4, 2018, at 4:11 PM, Louis Lagendijk  wrote:

The comment is correct: chcon will not survive a relabel. You need to
update the database first (semanage fcontext) and then let a relabel
apply the new context.

Alright, then why do I get that error when I give the command from this 
morning’s wiki text, and how do I avoid it?


# od -c
sudo semanage fcontext –at samba_share_t /path/to/share
000   s   u   d   o   s   e   m   a   n   a   g   e f   c
020   o   n   t   e   x   t 342 200 223   a   t   s a   m
040   b   a   _   s   h   a   r   e   _   t   /   p   a t   h
060   /   t   o   /   s   h   a   r   e  \n

You get the error because that isn't a hyphen, it's an en-dash. Someone 
probably copied and pasted from Word.

___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Samba HOWTO wiki bug: chcon samba_share_t

2018-05-04 Thread Warren Young
On May 5, 2018, at 12:04 AM, Gordon Messmer  wrote:
> 
> On 05/04/2018 04:05 PM, Warren Young wrote:
>> On May 4, 2018, at 4:11 PM, Louis Lagendijk  wrote:
>>> The comment is correct: chcon will not survive a relabel. You need to
>>> update the database first (semanage fcontext) and then let a relabel
>>> apply the new context.
>> Alright, then why do I get that error when I give the command from this 
>> morning’s wiki text, and how do I avoid it?
> 
> # od -c
> sudo semanage fcontext –at samba_share_t /path/to/share
> 000   s   u   d   o   s   e   m   a   n   a   g   e f   c
> 020   o   n   t   e   x   t 342 200 223   a   t   s a   m
> 040   b   a   _   s   h   a   r   e   _   t   /   p   a t   h
> 060   /   t   o   /   s   h   a   r   e  \n
> 
> You get the error because that isn't a hyphen, it's an en-dash. Someone 
> probably copied and pasted from Word.

The formatting is from my mailer.  The paste into the terminal wouldn’t have 
been affected.

And again, the chcon command succeeded, with the same type name, copied from 
the same source by the same method.
___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos