views:

85

answers:

1

Hi folks

I'm working on a server-side project that consists of several services. Each service is run in interactive (i.e. non-daemon) mode, this is handy while active development. The project is in virtualenv. So the typical way to start a service is:

$ cd ~/to/vitualenv/subdir/where/service/code/located
$ source ../path/to/virtualenv/bin/activate
$ ./script-to-start-service
+ Set title of terminal to the service name via GUI

It would be ok if there were 2-3 services at all. But we have a dozen. And restarting all of them after computer reboot is a real pain.

So what I want is a script, that once executed opens me new gnome-terminal window with a dozen of named tabs (one per service), with activated virtualenv in each and running bunch of service instances in that tabs. The best result I've got so far is:

$ gnome-terminal --working-directory=~/to/vitualenv/subdir --window --tab --tab

--title and --profile looks like been ignored and if --command is specified newly opened window is closed just in moment after open.

Any ideas? How to source activation script, give a title, and run service?

P.S. It is for development purposes only, not for deployment on real servers.

+1  A: 

The following works for me and do what you requested:

gnome-terminal --working-directory=/path/to/wd --tab-with-profile=profile1 --title=title1 -e 'bash --rcfile /path/to/rcfile1.sh' --tab-with-profile=profile2 --title=title2 -e 'bash --rcfile /path/to/rcfile2.sh'

Denis Otkidach
Wow! Works at most. But is there a way to throw rcfile*.sh files away? With pipes or so
nailxx