/srv/irclogs.ubuntu.com/2021/11/04/#ubuntu-server.txt

=== genii is now known as genii-core
=== thegodsquirrel is now known as thebotsquirrel
=== thebotsquirrel is now known as thegodsquirrel
=== genii-core is now known as genii
TonyStoneso i have an ubuntu server setup running.  i have a few programs i start from an SSH session... problem is when i start these programs they tie up my terminal... so i cant do anything else. is there any multitasking methods?22:44
TonyStonealso how can i make some of these programs start automatically after boot and be able to "open" the running instance in a remote terminal?22:44
tomreyn!tty | TonyStone 22:47
ubottuTonyStone: To get to the TTY terminals 3-6, use the keystroke Ctrl + Alt + F3-F6 respectively. Ctrl-Alt-F2 or Ctrl-Alt-F1 will get you back to your graphical login (Ctrl-Alt-F7 on 16.04). To change TTY resolution, see https://help.ubuntu.com/community/ChangeTTYResolution22:47
TonyStonethere is no graphical login... hmmm22:47
tomreynthere are also so-called terminal multiplexers which can also give you multiple 'screens', such as tmux (and byobu) and GNU screen22:48
tomreynit's a server, that's why there's no graphical login22:48
TonyStoneso when i SSH into my ubuntu server i can have different terminals via ctrl-alt f2-f6   m..... im trying now22:48
tomreynyou can also start processes and keep them running int he background, by adding "&" to the end of the command, then typing "bg" as in "background"22:49
TonyStonelol... except the ctrl-alt f3 changes my desktop to a terminal...22:49
TonyStonegotta send it through the ssh client some how... ok22:49
tomreynand last but not least you can write systemd unit files to have daemons start automatically at boot, or based on a schedule, or just when you start them manually.22:49
TonyStonespace between & BG ?22:49
tomreynoh you're not sitting in front of the server, connected with ssh, then tty switching by hotkeys won't work22:50
TonyStoneim gonna need them to start automnatically... so i will read up on systemd unit files22:50
tomreynenter between & and bg22:50
TonyStoneyeah i am remote22:50
TonyStoneok im trying these now... hold on...  ill be a half-arsed linux admin some day! lol22:51
TonyStoneok the & works great!22:51
tomreynTonyStone: if yuo have more details on what you're trying to accomplish / what these applications are supposed to do, maybe we can provide more targeted suggestions.22:52
TonyStoneso i have my server setup with TheLounge IRC web client...22:53
TonyStonebut in order for me to access it so far i have been logging in via SSH and then starting it. but then it ties up my terminal...22:53
TonyStoneso when i type BG it shows tony@irontowel:~$ sudo -u thelounge thelounge start &22:53
TonyStone[1] 33788622:53
TonyStonetony@irontowel:~$ bg22:53
TonyStone[1]+ sudo -u thelounge thelounge start &22:53
tomreyni.e. proper services / daemons are usually written in a way that they output primarily to a log file, not to screen (unless you start them in a verbose / debugging / stay in front mode), and come with a service file so that you can manage them with "systemctl"22:53
TonyStonesorry if i posted too many lines here... so now how do i access that application again to see if there is output22:54
=== genii is now known as genii-core
tomreynfg to put it into foreground again22:54
TonyStoneok... noted systemctl i will also read up on22:54
TonyStoneawesome!!!  that is great for the time being!22:55
TonyStoneso i am sure there would be arguments or parameters for fg command if i put several programs in the background...22:55
TonyStoneexcept now i am stuck in that program tying up my terminal again... how do i get back out of it now that i did fg?22:56
tomreyntry "help bg"22:56
tomreynor "help fg" for that matter22:56
tomreynthe "337886" you posted above is the process id of the process that you paused (using "&"), and later backgrounded.22:57
TonyStoneok will do... but then i have to exit the program i brought to fg. lol... i will get it now.. i am capable of reading help files.  my main problem is i dont know what to look for with some stuff that is very basic to lots of you guys, i am sure22:57
tomreyn"1" is the job spec22:57
tomreyn!terminal22:58
ubottuThe linux terminal or command-line interface is very powerful. In Unity or GNOME, search the dash for "terminal" and press ENTER. Other desktops: Applications -> System Tools -> Terminal (MATE), K-menu -> System -> Konsole (KDE), or Menu -> Accessories -> LXTerminal (LXDE). Guide: https://help.ubuntu.com/community/UsingTheTerminal22:58
tomreyn!shell22:58
tomreyntry this guide22:59
TonyStoneskimming that guide now :)23:00
TonyStonecrtl+ R  thats gonna be a good one! lol23:00
TonyStonein the past couple days i have learned so many linux server related things... setting up TheLounge.... and there is still so much more to go!  i setup haproxy on my bsd firewall to access the server... i dont know how sys admins remeber all this stuff!23:03
tomreynthey don't, they use "help" and "somecomand --help" and most of all "man somecommand"23:06
tomreyn!man23:06
ubottuThe "man" command brings up the Linux manual pages for the command you're interested in. Try "man intro" at the  command line, or see https://help.ubuntu.com/community/UsingTheTerminal | Manpages online: http://manpages.ubuntu.com/23:06
TonyStone!jobs23:07
tomreynwrong channel, try #mac23:07
TonyStonethanks for getting me in the right direction23:08
TonyStonelol23:08
sarnoldsometimes it's reading the source, too23:08
sarnoldI definitely prefer --help or manpages when they have my answers :)23:09
TonyStonethats the beauty of open source!  but so far... hopefully i wont get into much that serious.... this is all hobby stuff for now23:09
tomreynuntil you realize what a fine hobby that is23:10
TonyStoneyes... i wish i stuck to computer programming and other stuff as a kid... then got a job in the feild... now im mainly a dumb(actually a smart and good)HVAC tech... haha23:10
tomreynoh, there is also https://help.ubuntu.com/23:11
TonyStoneyeah i have been in the ubuntu help site a good bit the past few days...23:11
sarnoldTonyStone: there's pros and cons to everything; you're unlikely to be replaced by a team of a dozen in a far flung corner of the world23:12
TonyStonethat is a valid point!23:12
TonyStonea cron job could be appropriate to automatically start my application after system start up as well?23:15
sarnoldyes, that's very popular because it can be done with a single line in a single file. but it makes it very difficult to restart it properly, or check output from the program while it runs, etc23:16
TonyStoneahhh. ok.23:16
sarnoldso even though it's easy I think you're better off to set up a systemd service file for the service, so you can stop and start it reliably after boot23:16
TonyStoneso systemd is probably my best route23:16
TonyStoneok. perfect.23:17
TonyStonenow my program needs to start with a sudo command.  that probably adds complexities... hmmm... reading up on systemd now23:17
sarnoldsystemd won't need that :)23:18
TonyStoneso just use -uTheLoung TheLounge start23:19
TonyStone-u TheL....23:19
TonyStonebecause TheLounge documentation says it needs to run under the user TheLounge which i beleive it automatically created the user when i did the install23:20
tomreynquite often, ubuntu (debian) packages will already provide systemd integration. how did you install the software?23:21
TonyStonejust downloaded their .deb package23:21
TonyStonethen sudo apt install theloung.....deb23:22
sarnoldTonyStone: https://www.freedesktop.org/software/systemd/man/systemd.exec.html#User=23:22
tomreynhttps://github.com/thelounge/thelounge-deb23:22
tomreynlooks like it comes with systemd service units but just doesn't enable them by default23:23
TonyStoneomg! i missed all that on their dam page before!23:23
TonyStonesystemctl enable --now thelounge.service   oops23:23
TonyStonewelp... their system ctl unit seems to work fine... i think i missed that because i was using their getting started guide... and it doesnt seem to cover systemctl23:29
TonyStonewell... this is pretty exciting... i had lots of little battles setting this thing up!  Between using LeetsEncrypt for valid SSL certificates... haproxy... and so many things i forgot... my https://lazarus.chat irc web client seems to be securely running!    thanks for your time tomreyn and sarnold23:31
tomreynTonyStone: congrats. :) keep in mind that the internet *can* be a hostile place, there are constantly bots trying to hack into your services, so just setting things up is not enough, you'll need to maintain them23:35
TonyStoneyeah... i am constantly installing updates... and i do have concerns of security.  i tried following lots of guides for setting up haproxy via my pfsense firewall... so... i think as of now i did things mostly properly.23:37
TonyStonei think there is some possible issues with my firewall configuration for some not so important issues... but man.. this is like a full time job! lol23:38
TonyStonei had also setup openvpn and was playing with that for a while... and i became concerned over security issues so i disabled that for now because there was things i didnt understand yet23:38
TonyStonei remeber back in the 90s doing some web sites. using CGI and perl.  on shared web hosting service.  i was storing my users personal info un-encrypted. ... then the shared server was misconfigured because i had access to everyone elses web sites via FTP and SSH... so god only knows if someone saw the info i stored... i was a kid... i was getting into things with not enough experience lol23:41
tomreynTonyStone: you may want to check with the folks in #libera as to whether they're happy with you hosting a public web interface pointing at their servers. there can be reasons not to want this because it can be an entry point for abusive users, who they would not be able to ban (depending on how you have it configured)23:48
TonyStonei did discuss it with them in their IRC channel yesterday.  they didnt seem to be against it.  however it is gonna be public but for a small handful of people...23:49
TonyStonei may put some sort of access control on it23:49

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!