missing command output
For some Reason the output that i get from executing a command via Runtime.getRuntime().exec("command") is incomplete.
In this case I only get "Reading packet List... " isntead of also getting things likke "All packets are up to date." etc even though i get those when executing it manually in sheel. It ried stuff with debugger but wasnt able to find a work around for the problemm.
Environment Linux Debian Server
I am am aware that running java as root would be a great security risk. I circumvented it by using a dummy user which does not have sudo permission and allowing him to execute apt update and apt list --upgradeable.
30 Replies
⌛
This post has been reserved for your question.
Hey @Hype_the_Time! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
Well, I am pretty sure that the process write an error message. This error-message does not find its way to the inputstream. Try to print whats inside the getErrorStream() aswell. I believe the subprocess does not have a shell and you have to set the full path to the apt-executable.
ok ill look
Oh, hm. Since the "Reading packet List..." print to the stream, apt-command might found successfully.
My bad
Anyway, check the getErrorStream().
If you like, apache has a stunning abstraction. "commons-exec", I use it very often.
no it was an error
thought i cheked that gues i didnt.
whats that?
That code is a Maven dependency. Do you use maven?
i mean yes but whats cool about the packet
You have a watchdog for processes, you can answer questions of the app like "are you sure?[y/n]". It has a community.
I mean, for these questions, one can use
Scanner
/BufferedReader
Yes, that true. It just made my personal life much easier.
i mean is there a good way to detect a blue screen during package installation (prompts during installation after apt upgrade which you can overwrite using -y paramter)
🤨
You need to detect a blue-screen-of-death?
sometimes while its rare its not enver the case you can get a prompt like hey do you want to install the maintaniers version or keep your own because you modified it. during apt upgrade process
Ah, ok, a blue dialog (I think it is called OWL).
and because im not sitting in fornt of it that thing probably is holding it and i cant answer not see in this case maning i would need to kill it which means i need to do an reconfigure aftewards in best case
no idea about how the proper name is for that.
Linux doesn't have BSODs technically
nothing blue there
but kernel panics are an option
Anyways, If that happens, your application won't be running any more
the blue in case of the installation screen of bullsyeye is similar. not the graphical version though.
well if the kernel has issues, your application won't be running
No, he means a dialog in the console.
oh that configuration thing
when updating for example with ssh and you said like hey only ssh keys you modified it and if there are new fields added etc it may ask hey you modfied it do you want to update ir or keep your own etc
i need a way to handle THAT
you could do this: https://askubuntu.com/q/556385/966107
Ask Ubuntu
How can I install apt packages non-interactively?
If I run:
sudo apt-get --yes install postfix
or
sudo bash -c 'yes | apt-get --yes install postfix'
an interactive prompt appears to configure postfix. I need to automate the installation of po...
hm yeah looks good. would still be good to know like hye you got a question and we answered it. in case something goes wrong
Hm in this case there might be another approach. Start programatically a ssh-connection, you controll the full screen AND it might solve your user-rights-problem.
user rights is already done. i just have a application manager where i want to be hey theres an update click to install and reboot after or just install so i see when there are updates quickly
something in this direction. but name and id are incorrect and i need to have a look at the list but in concept
name and id?
reversed, name is what is displayed id is what discord tells you as button id. i put them in wrong order at definition
I know about the Discord API
So what's the problem?
oh nothing
setting it up atm
matter of time