You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@trafficserver.apache.org by "G. T. Stresen-Reuter" <te...@gmail.com> on 2013/02/12 13:49:25 UTC

How to Start Trafficserver on Init (Ubuntu Precise 12.04)

Hi,

I'm new to trafficserver (and the list). I've successfully installed it on ubuntu precise (12.04) and it seems to be working quite well. My thanks to the devs and all those who've put effort into making this work!

Although I'm familiar with the ubuntu init system, I'm having a little trouble figuring out where/how to tell trafficserver to start on system startup. My confusion is in two places:

1. Where in ubuntu do we add startup services? (I don't expect an answer to this one from this list, but thought I'd throw it out there).

2. What command do I use to start trafficserver: "traffic_manager start" or some other program? I'm asking this second one because I've seen conflicting examples: some use traffic_manager, some traffic_cop, and others appear to just use trafficserver itself.

And finally, if anyone knows of a good reference for a beginner, I would really love to learn more about setting up trafficserver for content filtering (I work in a school). I've read some articles but don't feel particularly prepared to sink my teeth into iptables without a considerable amount of additional research...

Thanks again.

Ted Stresen-Reuter
http://chicagoitsystems.com

Re: How to Start Trafficserver on Init (Ubuntu Precise 12.04)

Posted by "G. T. Stresen-Reuter" <te...@gmail.com>.
On Feb 15, 2013, at 3:16 PM, Williamson, Brad wrote:

> Ubuntu can be weird with some sudo commands, frequently the cause is missing environment settings or it gets confused by the trailing &. To rule that out, and possibly give you better error messages or results, try running your commands like this to see if it works better for you:
> 
> [brad@servername ~]$ sudo su - 
> [root@servername ~]# trafficserver start
> 
> Then see what is running. Mine looks like this (on RHEL, not Ubuntu, but should be similar with yours being in /usr/bin)
> 
> [root@servername ~]# ps -ef|grep traff
> root      6797     1  0 Jan15 ?        00:00:21 /usr/local/bin/traffic_cop
> nobody    6799  6797  0 Jan15 ?        00:10:05 /usr/local/bin/traffic_manager
> nobody    6834  6799  1 Jan15 ?        11:44:36 /usr/local/bin/traffic_server -M --httpport 80:fd=7,8080:fd=8
> root      7903  7833  0 07:10 pts/0    00:00:00 grep traff
> 

Thanks for the pointers. Ubuntu doesn't allow logging in as root by default so I tried something similar using sudo -i (which moves you into root's environment). On Ubuntu, the way to start a service is "/etc/init.d/servicename start" where "servicename" in this case would be "trafficserver". Unfortunately, the returned no result whatsoever and failed to launch the service.

It seems to me that this product is better supported on the RedHat side and this is on a Dell server, which also has better support in RedHat, so I think I'm simply going to reinstall and start from scratch :-(

Thanks again for your help.

Ted

RE: How to Start Trafficserver on Init (Ubuntu Precise 12.04)

Posted by "Williamson, Brad" <Br...@disney.com>.
Ubuntu can be weird with some sudo commands, frequently the cause is missing environment settings or it gets confused by the trailing &. To rule that out, and possibly give you better error messages or results, try running your commands like this to see if it works better for you:

[brad@servername ~]$ sudo su - 
[root@servername ~]# trafficserver start

Then see what is running. Mine looks like this (on RHEL, not Ubuntu, but should be similar with yours being in /usr/bin)

[root@servername ~]# ps -ef|grep traff
root      6797     1  0 Jan15 ?        00:00:21 /usr/local/bin/traffic_cop
nobody    6799  6797  0 Jan15 ?        00:10:05 /usr/local/bin/traffic_manager
nobody    6834  6799  1 Jan15 ?        11:44:36 /usr/local/bin/traffic_server -M --httpport 80:fd=7,8080:fd=8
root      7903  7833  0 07:10 pts/0    00:00:00 grep traff

Brad


-----Original Message-----
From: G. T. Stresen-Reuter [mailto:tedmasterweb@gmail.com] 
Sent: Thursday, February 14, 2013 4:48 AM
To: users@trafficserver.apache.org
Subject: Re: How to Start Trafficserver on Init (Ubuntu Precise 12.04)

On Feb 12, 2013, at 3:02 PM, Williamson, Brad wrote:

> I've had this script kicking around for a while. I'm sure the purists 
> will have other ways of doing things, but this works for me and added SNMP abilities to ATS that were not otherwise available. I've posted it here: http://www.8layer8.com/?p=997 Feel free to use and modify for your use.
> Brad

Thanks a lot for the ideas. Nice script! When I know more about this product I'm sure I'll appreciate it even more...

I reviewed the script and see right off the bat that there are some inconsistencies among platforms and/or versions. For example, in your script you use the trafficserver command (located in /usr/local/bin) to control the server. On my installation (Ubuntu precise 12.04) that command doesn't exist (probably because I installed it from a package). Rather, there are a series of commands in /urs/bin starting with traffic_*

Somewhere else on the interwebs I saw someone say you should use traffic_manager to control the server, but there is no man page associated with the program. If I run "sudo traffic_manager start" everything seems to run properly but "sudo traffic_manager start &" or "sudo nohup traffic_manager start" a really weird thing happens.... the process continues to run but the command returns either 1 or 2 (can't remember) with a message saying it quit, and although ps ax shows the service running, users seem unable to connect (but I could be wrong about that... haven't tested thoroughly enough because I saw the error).

I've also tried using traffic_line as documented here:
http://trafficserver.apache.org/docs/trunk/admin/traffic-line-commands/index.en.html

but no love here either. The result of the command "sudo traffic_line -L" (which the documentation would lead me to believe is to start up the service) is "error: the requested command failed"

So, any additional pointers would be greatly appreciated!

Sincerely,

Ted Stresen-Reuter

Re: How to Start Trafficserver on Init (Ubuntu Precise 12.04)

Posted by "G. T. Stresen-Reuter" <te...@gmail.com>.
On Feb 12, 2013, at 3:02 PM, Williamson, Brad wrote:

> I've had this script kicking around for a while. I'm sure the purists will have other ways of doing things, but this works for me and added SNMP abilities to ATS that were not otherwise available. I've posted it here: http://www.8layer8.com/?p=997
> Feel free to use and modify for your use.
> Brad

Thanks a lot for the ideas. Nice script! When I know more about this product I'm sure I'll appreciate it even more...

I reviewed the script and see right off the bat that there are some inconsistencies among platforms and/or versions. For example, in your script you use the trafficserver command (located in /usr/local/bin) to control the server. On my installation (Ubuntu precise 12.04) that command doesn't exist (probably because I installed it from a package). Rather, there are a series of commands in /urs/bin starting with traffic_*

Somewhere else on the interwebs I saw someone say you should use traffic_manager to control the server, but there is no man page associated with the program. If I run "sudo traffic_manager start" everything seems to run properly but "sudo traffic_manager start &" or "sudo nohup traffic_manager start" a really weird thing happens.... the process continues to run but the command returns either 1 or 2 (can't remember) with a message saying it quit, and although ps ax shows the service running, users seem unable to connect (but I could be wrong about that... haven't tested thoroughly enough because I saw the error).

I've also tried using traffic_line as documented here:
http://trafficserver.apache.org/docs/trunk/admin/traffic-line-commands/index.en.html

but no love here either. The result of the command "sudo traffic_line -L" (which the documentation would lead me to believe is to start up the service) is "error: the requested command failed"

So, any additional pointers would be greatly appreciated!

Sincerely,

Ted Stresen-Reuter

RE: How to Start Trafficserver on Init (Ubuntu Precise 12.04)

Posted by "Williamson, Brad" <Br...@disney.com>.
I've had this script kicking around for a while. I'm sure the purists will have other ways of doing things, but this works for me and added SNMP abilities to ATS that were not otherwise available. I've posted it here: http://www.8layer8.com/?p=997
Feel free to use and modify for your use.
Brad


-----Original Message-----
From: G. T. Stresen-Reuter [mailto:tedmasterweb@gmail.com] 
Sent: Tuesday, February 12, 2013 7:49 AM
To: users@trafficserver.apache.org
Subject: How to Start Trafficserver on Init (Ubuntu Precise 12.04)

Hi,

I'm new to trafficserver (and the list). I've successfully installed it on ubuntu precise (12.04) and it seems to be working quite well. My thanks to the devs and all those who've put effort into making this work!

Although I'm familiar with the ubuntu init system, I'm having a little trouble figuring out where/how to tell trafficserver to start on system startup. My confusion is in two places:

1. Where in ubuntu do we add startup services? (I don't expect an answer to this one from this list, but thought I'd throw it out there).

2. What command do I use to start trafficserver: "traffic_manager start" or some other program? I'm asking this second one because I've seen conflicting examples: some use traffic_manager, some traffic_cop, and others appear to just use trafficserver itself.

And finally, if anyone knows of a good reference for a beginner, I would really love to learn more about setting up trafficserver for content filtering (I work in a school). I've read some articles but don't feel particularly prepared to sink my teeth into iptables without a considerable amount of additional research...

Thanks again.

Ted Stresen-Reuter
http://chicagoitsystems.com