On 9/23/2015 2:58 PM, Jonathan Billings wrote:> 1.) why 'cd /greenstone/gs3 && ant start' when you could just run > '/greenstone/gs3/ant start'.thats *not* equivalent, unless ant is in /greenstone/gs3 *and* . is in the path, and even then, ant looks for build.xml in the current path when its invoked, so the cd /path/to/build/ is appropriate. -- john r pierce, recycling bits in santa cruz
On 24.09.2015 00:06, John R Pierce wrote:> On 9/23/2015 2:58 PM, Jonathan Billings wrote: >> 1.) why 'cd /greenstone/gs3 && ant start' when you could just run >> '/greenstone/gs3/ant start'. > > thats *not* equivalent, unless ant is in /greenstone/gs3 *and* . is in > the path, and even then, ant looks for build.xml in the current path > when its invoked, so the cd /path/to/build/ is appropriate.Mind you I only work with ant very rarely but what should work is this: /path/to/ant -buildfile /greenstone/gs3/build,xml -Dbasedir=/greenstone/gs3 Regards, Dennis
> > > Mind you I only work with ant very rarely but what should work is this: > /path/to/ant -buildfile /greenstone/gs3/build,xml -Dbasedir=/greenstone/gs3 >Dennis your suggestion works well so for the moment I am going with # Systemd unit file for Greenstone 3 [Unit] Description=Greenstone 3 Server After=syslog.target network.target [Service] Type=forking Environment=PATH=/usr/apache-ant-1.9.6/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin ExecStart=/usr/apache-ant-1.9.6/bin/ant -buildfile /greenstone/gs3/build.xml -Dbasedir=/greenstone/gs3 start ExecStop=/usr/apache-ant-1.9.6/bin/ant -buildfile /greenstone/gs3/build.xml -Dbasedir=/greenstone/gs3 stop SuccessExitStatus=143 User=gs3 Group=gs3 [Install] WantedBy=multi-user.target Thanks to everyone who commented :)