[jira] [Commented] (TS-4058) Logging doesn't work when TS is compiled and run w/ --with-user

2015-12-08 Thread Leif Hedstrom (JIRA)

[ 
https://issues.apache.org/jira/browse/TS-4058?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15047429#comment-15047429
 ] 

Leif Hedstrom commented on TS-4058:
---

This is somewhat confusing, I know for a fact that building with e.g.

{code}
 --with-user=foo \
 --with-group=bar
{code}

work. We obviously make the .../var/log/trafficserver owned accordingly, e.g.

{code}
[leif ~]$ ls -ld /var/log/trafficserver/
drwxrwxr-x 2 foo root 340 Dec  8 19:44 /var/log/trafficserver/
{code}

The above is with v5.3.x though, is this by chance a regression in 6.x?


> Logging doesn't work when TS is compiled and run w/ --with-user
> ---
>
> Key: TS-4058
> URL: https://issues.apache.org/jira/browse/TS-4058
> Project: Traffic Server
>  Issue Type: Bug
>  Components: Logging
>Reporter: Daniel Xu
>Assignee: Daniel Xu
>
> ie. we run this _without_ sudo. 
> traffic_cop output seems to point to permission errors that occur within 
> traffic_manager



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (TS-4058) Logging doesn't work when TS is compiled and run w/ --with-user

2015-12-07 Thread Daniel Xu (JIRA)

[ 
https://issues.apache.org/jira/browse/TS-4058?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15046448#comment-15046448
 ] 

Daniel Xu commented on TS-4058:
---

Noted. I'll think about some ideas to avoid these permission issues

> Logging doesn't work when TS is compiled and run w/ --with-user
> ---
>
> Key: TS-4058
> URL: https://issues.apache.org/jira/browse/TS-4058
> Project: Traffic Server
>  Issue Type: Bug
>  Components: Logging
>Reporter: Daniel Xu
>Assignee: Daniel Xu
>
> ie. we run this _without_ sudo. 
> traffic_cop output seems to point to permission errors that occur within 
> traffic_manager



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (TS-4058) Logging doesn't work when TS is compiled and run w/ --with-user

2015-12-07 Thread James Peach (JIRA)

[ 
https://issues.apache.org/jira/browse/TS-4058?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15046249#comment-15046249
 ] 

James Peach commented on TS-4058:
-

Running {{traffic_cop}} as an unprivileged user works and is supported. I 
specifically fixed it some time ago and would be quite sad if it was broken in 
the interim. TSQA is designed to run {{traffic_cop}} and also run unprivileged.

> Logging doesn't work when TS is compiled and run w/ --with-user
> ---
>
> Key: TS-4058
> URL: https://issues.apache.org/jira/browse/TS-4058
> Project: Traffic Server
>  Issue Type: Bug
>  Components: Logging
>Reporter: Daniel Xu
>Assignee: Daniel Xu
>
> ie. we run this _without_ sudo. 
> traffic_cop output seems to point to permission errors that occur within 
> traffic_manager



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (TS-4058) Logging doesn't work when TS is compiled and run w/ --with-user

2015-12-07 Thread Daniel Xu (JIRA)

[ 
https://issues.apache.org/jira/browse/TS-4058?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15045823#comment-15045823
 ] 

Daniel Xu commented on TS-4058:
---

The issue is in `Diags::set_std{out,err}_output()` because we indiscriminately 
call `ElevateAccess()`. There are a few issues preventing us from an "easy" 
fix. We need root access for the whole function because there's a bunch of 
`BaseLogFile` logic that assumes we have access to the log files we want. The 
best way (in my opinion) would be to make a function in `ink_cap.cc` that can 
check to see if we are able to elevate to root. We could then just use that 
function to decide if we want to call `ElevateAccess` at all. 

I'm not sure how to implement that feature and I probably won't be able to get 
around to this again for a few weeks.

> Logging doesn't work when TS is compiled and run w/ --with-user
> ---
>
> Key: TS-4058
> URL: https://issues.apache.org/jira/browse/TS-4058
> Project: Traffic Server
>  Issue Type: Bug
>  Components: Logging
>Reporter: Daniel Xu
>Assignee: Daniel Xu
>
> ie. we run this _without_ sudo. 
> traffic_cop output seems to point to permission errors that occur within 
> traffic_manager



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (TS-4058) Logging doesn't work when TS is compiled and run w/ --with-user

2015-12-07 Thread James Peach (JIRA)

[ 
https://issues.apache.org/jira/browse/TS-4058?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15045888#comment-15045888
 ] 

James Peach commented on TS-4058:
-

What is the actual problem here? The description is pretty unclear to me.

> Logging doesn't work when TS is compiled and run w/ --with-user
> ---
>
> Key: TS-4058
> URL: https://issues.apache.org/jira/browse/TS-4058
> Project: Traffic Server
>  Issue Type: Bug
>  Components: Logging
>Reporter: Daniel Xu
>Assignee: Daniel Xu
>
> ie. we run this _without_ sudo. 
> traffic_cop output seems to point to permission errors that occur within 
> traffic_manager



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (TS-4058) Logging doesn't work when TS is compiled and run w/ --with-user

2015-12-07 Thread Daniel Xu (JIRA)

[ 
https://issues.apache.org/jira/browse/TS-4058?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15045903#comment-15045903
 ] 

Daniel Xu commented on TS-4058:
---

If you run: 
{noformat}
./configure --with-user=danielxu --prefix=/home/danielxu/ats-test-env && cd 
~ats-test-env && bin/traffic_cop -od
{noformat}
You'll see error messages about permission denied. 

The reason it does that is because we always try to elevate our permissions to 
root in Diags without checking if we even have the ability to do that. We can't 
easily fix this problem unless we know if we are allowed to elevate to root. I 
can't figure out how to check if we are allowed to elevate to root. 

> Logging doesn't work when TS is compiled and run w/ --with-user
> ---
>
> Key: TS-4058
> URL: https://issues.apache.org/jira/browse/TS-4058
> Project: Traffic Server
>  Issue Type: Bug
>  Components: Logging
>Reporter: Daniel Xu
>Assignee: Daniel Xu
>
> ie. we run this _without_ sudo. 
> traffic_cop output seems to point to permission errors that occur within 
> traffic_manager



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (TS-4058) Logging doesn't work when TS is compiled and run w/ --with-user

2015-12-07 Thread James Peach (JIRA)

[ 
https://issues.apache.org/jira/browse/TS-4058?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15045931#comment-15045931
 ] 

James Peach commented on TS-4058:
-

This is the {{ElevateAccess}} introduced in TS-306?

> Logging doesn't work when TS is compiled and run w/ --with-user
> ---
>
> Key: TS-4058
> URL: https://issues.apache.org/jira/browse/TS-4058
> Project: Traffic Server
>  Issue Type: Bug
>  Components: Logging
>Reporter: Daniel Xu
>Assignee: Daniel Xu
>
> ie. we run this _without_ sudo. 
> traffic_cop output seems to point to permission errors that occur within 
> traffic_manager



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (TS-4058) Logging doesn't work when TS is compiled and run w/ --with-user

2015-12-07 Thread Daniel Xu (JIRA)

[ 
https://issues.apache.org/jira/browse/TS-4058?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15045936#comment-15045936
 ] 

Daniel Xu commented on TS-4058:
---

Yes. It wasn't caught earlier because there's no tests to catch it. 

> Logging doesn't work when TS is compiled and run w/ --with-user
> ---
>
> Key: TS-4058
> URL: https://issues.apache.org/jira/browse/TS-4058
> Project: Traffic Server
>  Issue Type: Bug
>  Components: Logging
>Reporter: Daniel Xu
>Assignee: Daniel Xu
>
> ie. we run this _without_ sudo. 
> traffic_cop output seems to point to permission errors that occur within 
> traffic_manager



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (TS-4058) Logging doesn't work when TS is compiled and run w/ --with-user

2015-12-07 Thread Zhao Yongming (JIRA)

[ 
https://issues.apache.org/jira/browse/TS-4058?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15046156#comment-15046156
 ] 

Zhao Yongming commented on TS-4058:
---

good catch, _cop is design to be run as root, and --with-user=danielxu 
specified the _server to be run as danielxu, that is the current setup. 
currently one unprivileged user should not run _cop, in the past it even fail 
if you want to make install as no-root, haha. in most case we would advice to 
run with _server directly for small testing with _server.

It would be nice if you want can make _cop run with unprivileged user.

> Logging doesn't work when TS is compiled and run w/ --with-user
> ---
>
> Key: TS-4058
> URL: https://issues.apache.org/jira/browse/TS-4058
> Project: Traffic Server
>  Issue Type: Bug
>  Components: Logging
>Reporter: Daniel Xu
>Assignee: Daniel Xu
>
> ie. we run this _without_ sudo. 
> traffic_cop output seems to point to permission errors that occur within 
> traffic_manager



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)