Getting error "Failed to start Artifactory service" after Artifactory installation - service

Getting this error after installing Artifactory
artifactory.service - Artifactory service
Loaded: loaded (/usr/lib/systemd/system/artifactory.service; enabled; vendor preset: disabled)
Active: activating (auto-restart) (Result: protocol) since Mon 2023-02-13 14:14:06 UTC; 43s ago
Process: 1469 ExecStart=/opt/jfrog/artifactory/app/bin/artifactoryManage.sh start (code=exited, status=0/SUCCESS)
Main PID: 26760 (code=exited, status=143)
Feb 13 14:14:06 mbiazelkdynatrace systemd[1]: Failed to start Artifactory service.
Feb 13 14:14:06 mbiazelkdynatrace systemd[1]: Unit artifactory.service entered failed state.
Feb 13 14:14:06 mbiazelkdynatrace systemd[1]: artifactory.service failed.
[root#mbiazelkdynatrace run]# systemctl status artifactory.service
Please help figure out the issue; I've trying this for the last two weeks.

Since you are trying to start for the first time, there may be an issue with ports where the ports required for Artifactory might already being used.
The above snippet does not reveal anything of the issue.
Can you try to perform the below steps.
Stop Artifactory from service.
Navigate to $JFROG_HOME/artifactory/app/bin (ideally /opt/jfrog/artifactory/app/bin if you have not changed the default location)
./artifactoryctl start
Navigate to $JFROG_HOME/artifactory/var/log location
tail the console.log that should reveal what is the issue.
or artifactory-service.log should reveal the issue.
If nothing is found, share the error snippet from artifactory-service.log

Related

Mongod does not start: mongod.service: Failed with result 'signal'

I currently have MongoDB 4.4 installed, as my system does not support 5.0. I have previously had 4.4 installed on Arch Linux, however when I moved over to Ubuntu and tried to run mongod, I get this result from systemd:
● mongod.service - MongoDB Database Server
Loaded: loaded (/lib/systemd/system/mongod.service; disabled; vendor preset: enabled)
Active: failed (Result: signal) since Fri 2021-12-10 15:57:00 CST; 2min 3s ago
Docs: https://docs.mongodb.org/manual
Process: 4369 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=killed, signal=ILL)
Main PID: 4369 (code=killed, signal=ILL)
Dec 10 15:57:00 system systemd[1]: Started MongoDB Database Server.
Dec 10 15:57:00 system systemd[1]: mongod.service: Main process exited, code=killed, status=4/ILL
Dec 10 15:57:00 system systemd[1]: mongod.service: Failed with result 'signal'.
MongoDB fails before logs can be created.
While this doesn't completely solve the issue, I'm fine with this resolution:
For whatever reason, 4.2 works fine, but 4.4 doesn't, even though I was completely fine running 4.4 on Arch.

mongodb service fail after reinstalling it on ubuntu

i was using mongodb and it was fine.
then i wanted to convert it to replica set and i get into some problems and i uninstalled it.
after reinstalling (10 times and doing everything on internet xD) why i check status with systemctl status it say failed with exit_code ( i know my conf file dont have problem).
what can i do? i even installed the 3.3 version and even it doesnt start anymore.
i used anything that it came to my mind (purging config files & lot more...).
i really dont want to reinstall my os (really cant).
this is my sudo systemctl status mongod
● mongod.service - MongoDB Database Server
Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2021-02-18 20:05:20 +0330; 8s ago
Docs: https://docs.mongodb.org/manual
Process: 147513 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=exited, status=1/FAILURE)
Main PID: 147513 (code=exited, status=1/FAILURE)
Feb 18 20:05:20 nima-Lenovo-ideapad-320-15AST systemd[1]: Started MongoDB Database Server.
Feb 18 20:05:20 nima-Lenovo-ideapad-320-15AST mongod[147513]: about to fork child process, waiting until server is ready for connections.
Feb 18 20:05:20 nima-Lenovo-ideapad-320-15AST mongod[147527]: forked process: 147527
Feb 18 20:05:20 nima-Lenovo-ideapad-320-15AST mongod[147513]: ERROR: child process failed, exited with 1
Feb 18 20:05:20 nima-Lenovo-ideapad-320-15AST mongod[147513]: To see additional information in this output, start without the "--fork" option.
Feb 18 20:05:20 nima-Lenovo-ideapad-320-15AST systemd[1]: mongod.service: Main process exited, code=exited, status=1/FAILURE
Feb 18 20:05:20 nima-Lenovo-ideapad-320-15AST systemd[1]: mongod.service: Failed with result 'exit-code'.
I solved the problem by changing the default mongodb port from port 27017 to port 27018 in /etc/mongod.conf.
I'm sure this will come handy to a lot of people.
And for the last part, after uninstalling mongodb I removed mongod.service files (every file) in the system and systemd directories in root and installed mongodb again.
(so I think uninstalling mongodb wasn't complete at first time. And 2 instances interfere with each other. Now everything works fine in mongodb with port 27018).

systemd service activation for Python script fails

I want to register a python script as a daemon service, executed at system startup and running continuously in the background. The script opens network sockets, a local log file and executes a number of threads. The script is well-formed and runs without any compilation or runtime issues.
I used below service file for registration:
[Unit]
Description=ModBus2KNX Gateway Daemon
After=multi-user.target
[Service]
Type=simple
ExecStart=/usr/bin/python3 /usr/bin/ModBusDaemon.py
[Install]
WantedBy=multi-user.target
Starting the service results in below error:
● ModBusDaemon.service - ModBus2KNX Gateway Daemon
Loaded: loaded (/lib/systemd/system/ModBusDaemon.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2021-01-04 21:46:29 CET; 6min ago
Process: 1390 ExecStart=/usr/bin/python3 /usr/bin/ModBusDaemon.py (code=exited, status=1/FAILURE)
Main PID: 1390 (code=exited, status=1/FAILURE)
Jan 04 21:46:29 raspberrypi systemd[1]: Started ModBus2KNX Gateway Daemon.
Jan 04 21:46:29 raspberrypi systemd[1]: ModBusDaemon.service: Main process exited, code=exited, status=1/FAILURE
Jan 04 21:46:29 raspberrypi systemd[1]: ModBusDaemon.service: Failed with result 'exit-code'.
Appreciate your support!
Related posts brought me to the resolution for my issue. Ubuntu systemd custom service failing with python script refers to the same issue. The proposed solution adding the WorkingDirectory to the Service section resolved the issue for me. Though, I could not find the adequate systemd documentation outlining on the implicit dependency.
As MBizm saim you must also add WorkingDirectory.
And After that you must also run these commands:
sudo systemctl daemon-reload
sudo systemctl enable your_service.service
sudo systemctl start your_service.service

systemctl Myservice.service not found

When I keep my Myservice.service file in /etc/systemd/system/Myservice.service. I get not-found error.
systemctl status Myservice
● Myservice.service
Loaded: not-found (Reason: Unit Myservice.service not found.)
Active: failed (Result: exit-code) since Thu 2020-08-27 11:04:58 EDT; 22min ago
Main PID: 3539430 (code=exited, status=125)
But when I keep the same service file in /lib/systemd/system/Myservice.service. It works fine.
But why doesn't it work in the first scenario? why systemd not able to find file in first case. How can I debug this scenario with systemd.
I figured it out, In RHEL 8, My Myservice.service default selinux context is unconfined_u:object_r:admin_home_t:s0 under /etc/systemd/system/, I changed it to system_u:object_r:systemd_unit_file_t:s0. and That's it!

Kestrel failed to start UBUNTU 16.04

I have the folowing config:
[Unit]
Description=Example .NET Web API Application running on CentOS 7
[Service]
WorkingDirectory=/var/www/FEEDER
ExecStart=/usr/bin/dotnet /var/www/FEEDER/FeedService.MVC.dll
SyslogIdentifier=dotnet-example
User=www-data
Environment=ASPNETCORE_ENVIRONMENT=Development
[Install]
WantedBy=multi-user.target
when I start the prgram I dont get any error.
the status throw this:
sudo ystemctl status kestrel-hellomvc.service
● kestrel-hellomvc.service - Example .NET Web API Application running on CentOS 7
Loaded: loaded (/etc/systemd/system/kestrel-hellomvc.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since ג' 2017-10-31 09:26:20 IST; 54min ago
Main PID: 20077 (code=exited, status=131/n/a)
אוק 31 09:26:20 avi-VirtualBox systemd[1]: Stopped Example .NET Web API Application running on CentOS 7.
אוק 31 09:26:20 avi-VirtualBox systemd[1]: Started Example .NET Web API Application running on CentOS 7.
אוק 31 09:26:20 avi-VirtualBox systemd[1]: kestrel-hellomvc.service: Main process exited, code=exited, status=131/n/a
אוק 31 09:26:20 avi-VirtualBox systemd[1]: kestrel-hellomvc.service: Unit entered failed state.
אוק 31 09:26:20 avi-VirtualBox systemd[1]: kestrel-hellomvc.service: Failed with result 'exit-code'.
Warning: kestrel-hellomvc.service changed on disk. Run 'systemctl daemon-reload' to reload units.
the owner of the folder is www-data and the permissions are 0755
What might be the problem?
Thanks
you should deploy your app myapp with:
sudo cp -a /home/user/myapp/bin/Debug/netcoreapp2.0/publish/* /var/aspnetcore/myapp
eg.
Copy all files from build folder to deployment location (*.json etc)