I can't launch a file called pteroq.service in wsl - windows

I'm trying to install https://pterodactyl.io/ in wsl
I have the problem when launching the services.
I am creating this file "pteroq.service" in "/etc/systemd/system"
Sure, the problem is that I can't use this command "sudo systemctl enable --now pteroq.service"
Why wsl doesn't work systemctl, I have to use sudo service, to activate the services.
The problem that the file that it creates tells me that it does not recognize it as a service.
Is there any way to create a script or something that launches the service?

Related

How to start Memgraph database on Ubuntu?

I know that there are two ways to run Memgraph on Ubuntu:
sudo systemctl start memgraph
sudo service memgraph start
Is there a preferred way to run Memgraph?
I've seen that if Ubuntu is run as WSL that the command for running it is sudo runuser -l memgraph -c '/usr/lib/memgraph/memgraph'. Can I use this command also on standalone Ubuntu installation, or is this one only for WSL?
systemctl interacts with systemd which is an init(and manager) system. When the Linux kernel is booted, there are some services that must start, etc. These are managed by systemd which is controlled by systemctl. service is the same as systemctl but for older systems which do not use systemd as their init system.
This command is simply running the executable placed in /usr/lib/memgraph/memgraph with the user memgraph.
The difference between these two is that the latter one won't start on the startup while the first one will.

Running IPFS Desktop and CLI simultaneously

This is a rather beginner question. Apologies for nothing more challening :)
I am running IPFS Desktop on my computer. I downloaded it via the Ubuntu Software Center. I believe it's a snap install. I am using Ubuntu 20.04
I want to be able to access some of the CLI commands for the node that is being run via the IPFS Desktop but when I enter any ipfs command in the terminal, it says command not found. etc.
If I install the ipfs cli then it runs a different node through the terminal. Am I missing something obvious here? How can I access the IPFS Desktop node through the command line?
Thanks!
Without running into distribution/package-specifics, below are two ways that should work on all systems.
Quick ad-hoc solution: point the ipfs CLI client at the node run by IPFS Desktop by passing an explicit API endpoint (ipfs --api=/ip4/127.0.0.1/tcp/5001). You can find exact address via Status_→_Advanced_→_API in WebUI provided by Desktop app.
Alternative is to set IPFS_PATH variable in your env to the directory used by IPFS Desktop, ensuring ipfs CLI tool uses the same repo as Desktop app. This is especially useful when you need to run a command that does not work over API and requires direct access the repository (like ipfs key export|rotate).
Thank you all for your answers. I believe the problem was in installing it using snap store (Ubuntu Software Center) because this changes the default path of the installations. So in effect, the desktop and cli were installed at separate paths.
I followed the installation on the IPFS site which uses the install script and that put it in the correct path.
So I re-installed only the CLI and use the webUI in place of the desktop. Along with IPFS Companion, desktop is not really needed.
But I still wanted the functionality of having the desktop run the daemon behind the scenes without having a terminal open, so I created the following service unit file to do that:
Paste the following code in the file /etc/systemd/system/ipfs.service
[Unit]
Description=IPFS Daemon
After=network.target
[Service]
Type=simple
ExecStart=/usr/local/bin/ipfs daemon
User=user
Restart=on-failure
[Install]
WantedBy=default.target
Then I simply ran sudo systemctl start ipfs in a terminal to get the daemon running as a service.
Thanks!
Yes IPFS should not be installed as a snap as you discovered it creates a second path. Installation is preferred by deb over appimage as the appimage limits user to only GUI interface. Another possible pitfall in the future could be the definition of "daemon" and "cluster". These are true to Unix definitions so a "daemon" is a service that manages a number of nodes on the same machine. Cluster is for multiple nodes that are physically seperated to different machines and locales. Other than that I'd say you are on the right path!

Using AWS CLI with MobaXterm on Windows

I am a newbie to both AWS and MobaXterm. I am trying to use MobaXterm to manage AWS instances because it comes with bash.
I am following the commands as per https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-linux.html.
When I run the following command $ sudo ./aws/install, I get the following error:
Unable to start 'install': There is no application associated with the
given file name extension.
I did run chmod 777 to ensure that I am able to read/write/execute. Please see attached image.
I do know that I can use Windows CLI installer in command line. However, doing SSH to EC2 is a nightmare in Windows with all certificates. With MobaXterm (because of bash), it is very easy. So, my preference is to use MobaXterm instead of Windows command prompt.
Moreover, I don't want to directly install Ubuntu. Hence, I am looking for some guidance here. I'd appreciate any help.
I am hoping that I am not missing any package. Thanks for any help.
In order for AWS cli to run on MobaXterm, you will need to run the following commands in MobaXterm:
MobApt install python2-pip
pip2 install awscli
It will take some time for MobaXterm to complete steps 1 and 2. Also, AWS cli runs super slow in MobaXterm. You are better off using cmd.
This is the site that helped me ran AWS cli on MobaXterm.
https://majornetwork.net/2017/07/installing-aws-cli-on-cygwin/

How do I start MongoDB in a script?

I'm trying to create a script to start different things. Whenever I add the below to the script and run it, I get a message: "mongod: unrecognized service". I can use it in the terminal, but not through the script.
sudo service mongod start
I got it to start just using sudo service mongod start. The .sh file was created in Windows. Once I deleted it and created a .sh file in Linux, it ran.
Try
sudo service mongodb start
mongod/mongodb depends on Linux version

How to run a sudo privilege command on start up in OSX

I have a python script which I'd like to run every time my machine boots. It requires sudo however. What's a simple solution to make my python script with sudo on startup?
For non-privileged startup scripts simply add your single line command to /etc/rc.local for commands that require sudo add it to /etc/rc.common.
You can use launchd.
launchd -- System wide and per-user daemon/agent manager
Add your property list file to the /Library/LaunchDaemons directory.
Have a look at Technical Note TN2083 Daemons and Agents

Resources