[EdLUG] How can I troubleshoot misbehaving java application

Tahir Hafiz tahir.hafiz at gmail.com
Wed Dec 9 13:02:26 UTC 2020


Thanks all - I didn't realise I there was a character limit.
Systemd is certainly an interesting beast :-)

By the way, What's  the way to nohup the following command:
npm run build:production

Is it just this?:
nohup npm run build:production

Or do I need some extra characters there??

Thank you.

On Tue, Dec 8, 2020 at 8:11 PM Matthew Rankine <matthew at mrankine.com> wrote:
>
> I believe systemd limits the length of lines in unit files to 2048 characters.
>
> Swithun's email seemed correct to me: your ExecStart (as pasted in 1849 email) had a typo, it included:
>
> -Dhttp.nonProxyHosts=*.service.nexte-Dhttps.proxyHost=internal-outbounds-nat-1.eu-west-2.elb.amazoneaws.com
>
> which should have read:
>
> -Dhttp.nonProxyHosts=*.service.nexte -Dhttps.proxyHost=internal-outbounds-nat-1.eu-west-2.elb.amazoneaws.com
>
> Glad you got it fixed!
>
> On Tue, 8 Dec 2020 at 20:01, Tahir Hafiz <tahir.hafiz at gmail.com> wrote:
>>
>> It's okay - it's working now - I got rid of the extra stuff and ran
>> the ExecStart line with the stuff that worked manually and now it no
>> longer crashes!
>>
>> I just changed the ExecStart to be more simple with just proxy info
>> and now the app runs without crashing. Maybe systemd can't handle too
>> many flags or the flags are too long - I mean it was a huge one liner!
>>
>> On Tue, Dec 8, 2020 at 7:29 PM Tahir Hafiz <tahir.hafiz at gmail.com> wrote:
>> >
>> > Yep, no spaces in the -Dhttps.proxy flags.
>> >
>> > So from what you are saying the flags should be passed in?
>> > It is just one long ExecStart line.
>> >
>> > I can run my the application manually by:
>> > java proxy_info_flags _proxy_stuff -jar my_java_app.jar
>> >
>> > And it works fine, it's able to pick up the proxy and the app is able
>> > to talk https outbound.
>> >
>> > Just when systemd runs it up with those flags it doesn't pick up the
>> > https proxy and it barfs on start-up and then it keeps starting up
>> > again, crashing, starting, crashing, ... etc... because of systemd
>> > restart every 10 seconds.
>> > I just don't know what's wrong.
>> >
>> > Tai - good shout about running the commands in screen or tmux - so if
>> > I screen/tmux it, the parent shell kicks me out, the sub-shell will
>> > keep running! Brilliant - thank you!!
>> >
>> > Cheers,
>> > Tahir
>> >
>> > On Tue, Dec 8, 2020 at 7:21 PM Tai Kedzierski <dch.tai at gmail.com> wrote:
>> > >
>> > > @Swithun Java has a parameterisation thing that specifies passing the "-D<argument>" thing with no spaces...
>> > >
>> > > // Sent from a mobile device. Typos and brevity may transpire.
>> > >
>> > > On Tue, 8 Dec 2020, 19:17 Swithun Crowe, <swithun at swithun.com> wrote:
>> > >>
>> > >> Hello
>> > >>
>> > >> TH> It’s a line like this in the systemd service file:ExecStart=/bin/java
>> > >> TH> -Xmx1200m -Dhttp.nonProxyHosts=*.service.nexte-Dhttps.proxyHost=internal-outbounds-nat-1.eu-west-2.elb.amazoneaws.com
>> > >> TH> -Dhttps.proxyPort=3128 -Dlogging.config=/opt/my-api/config/logback.xml
>> > >> TH> -jar /opt/my-api/my-api-6.1.jar
>> > >>
>> > >> Has the line got mangled in an email, or should there be spaces between
>> > >> the -D... flags?
>> > >>
>> > >> Looking at my systemd .service files, the ExecStart lines have arguments
>> > >> that get passed to the commands.
>> > >>
>> > >> TH> Also, how can I log into different server boxes and run these two
>> > >> TH> commands in a shell but with some kind of nohup option (or similar) so
>> > >> TH> the process won’t crash if I get timed out (kicked out) from the
>> > >> TH> shells:
>> > >>
>> > >> Can you install GNU screen or tmux on these servers? If you start a
>> > >> session, and run the commands in there, you can disconnect (or get
>> > >> disconnected) and the processes will keep running.
>> > >>
>> > >> Good luck.
>> > >>
>> > >> Swithun.--
>> > >> EdLUG mailing list
>> > >> EdLUG at mailman.lug.org.uk
>> > >> https://lists.edlug.org.uk/mailman/listinfo/edlug
>> > >
>> > > --
>> > > EdLUG mailing list
>> > > EdLUG at mailman.lug.org.uk
>> > > https://lists.edlug.org.uk/mailman/listinfo/edlug
>>
>> --
>> EdLUG mailing list
>> EdLUG at mailman.lug.org.uk
>> https://lists.edlug.org.uk/mailman/listinfo/edlug
>
> --
> EdLUG mailing list
> EdLUG at mailman.lug.org.uk
> https://lists.edlug.org.uk/mailman/listinfo/edlug



More information about the EdLUG mailing list