How do I run multiple dotnet commands?

Mark Mueller

I have recently installed the .Net core framework 2.2 from Microsoft's website on my Ubuntu server.

Whenever you run the dotnet [.dll file] it will have a prompt saying:

Application running on port 3030

Press Ctrl+C to close server

I was wondering how would I be able to run more than one .Net Core application. It seems I can SSH the server again and load up another application. That will load both applications at once.

Is there a way where I can bypass the keyboard lock when it only lets me to press Ctrl+C?

garethTheRed

You can suspend the application with Ctl+z. Once suspended, resume the application in the background with the bg command, or you can bring it back to the foreground again with the fg command. If you background the application and run more applications afterwards, you can find the job number of your application with the jobs command after which you can use fg <job number> to bring it to the foreground before stopping it with Ctl+c.


A better approach is to create a Systemd unit file which allows you to stop and start the service at your leisure or on boot. Run sudo systemctl edit --force myFirstDotNetService.service. In the editor, add the following:

[Unit]
Description= My First Dot Net Service

[Service]
ExecStart = /path/to/dotnet /path/to/dll-file

[Install]
WantedBy=multi-user.target

There are many more options you can add to this file, but the above should get you started.

Next, let the server know about this new file with: sudo systemctl daemon-reload.

You can now start the service with: sudo systemctl start myFirstDotNetService and stop it with sudo systemctl stop myFirstDotNetService. When you start, the application is placed in the background and the command prompt returns.

You can make it automatically start at boot with: sudo systemctl enable myFirstDotNetService and stop this with sudo systemctl disable myFirstDotNetService.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How do I run multiple commands together in the background?

From Dev

How do I run multiple commands together in the background?

From Dev

How do I run multiple commands on one line in PowerShell?

From Dev

How do I write a command in vim to run multiple commands?

From Dev

How do I run multiple terminal commands in Visual Studio Code?

From Dev

How do I run many SSH remote commands, on multiple machines, in batch?

From Dev

How do I run specific tests using dotnet test?

From Dev

How do I see the history of the commands I have run in tmux?

From Dev

How do I see the history of the commands I have run in tmux?

From Dev

How do you run Multiple XMLA Alter Commands at the same time?

From Dev

How can I run multiple pv commands in parallel?

From Dev

supervisor - how to run multiple commands

From Java

How do I run two commands in one line in Windows CMD?

From Dev

How do I run only some makefile commands as root?

From Dev

How do I run execute commands from a file?

From Dev

How do I run commands on suspend/return from suspend?

From Dev

Fig: how do I run commands on an existing container?

From Dev

How do I run two shell commands in one line in Vim?

From Dev

How do I run specific sudo commands without a password?

From Dev

How do I run execute commands from a file?

From Dev

How do I run commands in a script as another user?

From Dev

How do I run a set of Terminal commands from a spreadsheet?

From Dev

How do I run all commands via Comspec?

From Dev

How do I run find and cp commands concurrently in Linux?

From Dev

How do I run R in multiple machines?

From Dev

How do I run a command on multiple files

From Dev

How do I run R in multiple machines?

From Dev

How do I run multiple terminals in vps

From Dev

How do I use multiple copy commands in Grunt Build?

Related Related

  1. 1

    How do I run multiple commands together in the background?

  2. 2

    How do I run multiple commands together in the background?

  3. 3

    How do I run multiple commands on one line in PowerShell?

  4. 4

    How do I write a command in vim to run multiple commands?

  5. 5

    How do I run multiple terminal commands in Visual Studio Code?

  6. 6

    How do I run many SSH remote commands, on multiple machines, in batch?

  7. 7

    How do I run specific tests using dotnet test?

  8. 8

    How do I see the history of the commands I have run in tmux?

  9. 9

    How do I see the history of the commands I have run in tmux?

  10. 10

    How do you run Multiple XMLA Alter Commands at the same time?

  11. 11

    How can I run multiple pv commands in parallel?

  12. 12

    supervisor - how to run multiple commands

  13. 13

    How do I run two commands in one line in Windows CMD?

  14. 14

    How do I run only some makefile commands as root?

  15. 15

    How do I run execute commands from a file?

  16. 16

    How do I run commands on suspend/return from suspend?

  17. 17

    Fig: how do I run commands on an existing container?

  18. 18

    How do I run two shell commands in one line in Vim?

  19. 19

    How do I run specific sudo commands without a password?

  20. 20

    How do I run execute commands from a file?

  21. 21

    How do I run commands in a script as another user?

  22. 22

    How do I run a set of Terminal commands from a spreadsheet?

  23. 23

    How do I run all commands via Comspec?

  24. 24

    How do I run find and cp commands concurrently in Linux?

  25. 25

    How do I run R in multiple machines?

  26. 26

    How do I run a command on multiple files

  27. 27

    How do I run R in multiple machines?

  28. 28

    How do I run multiple terminals in vps

  29. 29

    How do I use multiple copy commands in Grunt Build?

HotTag

Archive