LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-08-2024, 12:50 AM   #1
soccerdude71
LQ Newbie
 
Registered: Feb 2024
Posts: 7

Rep: Reputation: 0
systemd - Not Working!


Hello Friends,

I'm a super-noob - please be patient....

I am trying to setup my mining program to run everytime I reboot....

The way I run it is this:

sudo cgminer -o stratum+tcp://us-east.stratum.braiins.com:3333 -u soccerdude71.GekkoMiners -p x --suggest-diff 442 --gekko-compacf-freq 400 --gekko-start-freq 300 --gekko-tune-up 85 --gekko-mine2 --gekko-tune2 60

Here is what my .service file looks like (BTC_miners_on_startup.service):

[Unit]
Description=Turns on BTC USB miners on startup
After=multi-user.target

[Service]
ExecStart=sudo cgminer -o stratum+tcp://us-east.stratum.braiins.com:3333 -u soccerdude71.GekkoMiners -p x --suggest-dif>

[Install]
WantedBy=multi-user.target

When I run systemctl status BTC_miners_on_startup.service:

BTC_miners_on_startup.service - Turns on BTC USB miners on startup
Loaded: loaded (/lib/systemd/system/BTC_miners_on_startup.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2024-02-07 22:20:09 PST; 26min ago
Process: 475 ExecStart=sudo cgminer -o stratum+tcp://us-east.stratum.braiins.com:3333 -u soccerdude71.GekkoMiners ->
Main PID: 475 (code=exited, status=1/FAILURE)
CPU: 295ms

Feb 07 22:20:06 raspberrypi systemd[1]: Started Turns on BTC USB miners on startup.
Feb 07 22:20:08 raspberrypi sudo[475]: root : PWD=/home/pi/cgminer ; USER=root ; COMMAND=/usr/local/bin/cgminer -o >
Feb 07 22:20:08 raspberrypi sudo[475]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=0)
Feb 07 22:20:09 raspberrypi sudo[508]: [2024-02-07 22:20:09.541] cgminer: --gekko-tune2: '60User=pi' is not a number
Feb 07 22:20:09 raspberrypi sudo[508]: [2024-02-07 22:20:09.541] cgminer: --gekko-tune2: '60User=pi' is not a number
Feb 07 22:20:09 raspberrypi sudo[475]: pam_unix(sudo:session): session closed for user root
Feb 07 22:20:09 raspberrypi systemd[1]: BTC_miners_on_startup.service: Main process exited, code=exited, status=1/FAILU>
Feb 07 22:20:09 raspberrypi systemd[1]: BTC_miners_on_startup.service: Failed with result 'exit-code'.
lines 1-15/15 (END)


What am i doing wrong??

Last edited by soccerdude71; 02-08-2024 at 12:51 AM.
 
Old 02-08-2024, 02:29 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,863

Rep: Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311
it is not systemd which does not work, but your own service
Otherwise there is an error message: cgminer: --gekko-tune2: '60User=pi' is not a number
I guess a space is missing somewhere
 
Old 02-08-2024, 02:53 AM   #3
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,453
Blog Entries: 7

Rep: Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555
Quote:
Originally Posted by soccerdude71 View Post
What am i doing wrong??
Using a systemd based distro.
 
2 members found this post helpful.
Old 02-08-2024, 11:12 AM   #4
soccerdude71
LQ Newbie
 
Registered: Feb 2024
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pan64 View Post
it is not systemd which does not work, but your own service
Otherwise there is an error message: cgminer: --gekko-tune2: '60User=pi' is not a number
I guess a space is missing somewhere
But this is an EXACT copy and paste of the command that is working.... You're just not seeing the whole copy/paste from nano. But if you look at my script at the top, that is what is in there:

sudo cgminer -o stratum+tcp://us-east.stratum.braiins.com:3333 -u soccerdude71.GekkoMiners -p x --suggest-diff 442 --gekko-compacf-freq 400 --gekko-start-freq 300 --gekko-tune-up 85 --gekko-mine2 --gekko-tune2 60

Last edited by soccerdude71; 02-08-2024 at 11:18 AM.
 
Old 02-08-2024, 11:12 AM   #5
soccerdude71
LQ Newbie
 
Registered: Feb 2024
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by rkelsen View Post
Using a systemd based distro.
Thanks! I am a noob at this, could you elaborate?
 
Old 02-08-2024, 11:42 AM   #6
jmccue
Member
 
Registered: Nov 2008
Location: US
Distribution: slackware
Posts: 691
Blog Entries: 1

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Quote:
Originally Posted by soccerdude71 View Post
Thanks! I am a noob at this, could you elaborate?
You do not what that That will result in yet another mega systemd mega-thread. Go a google search for answer.

I know little about systemd, but I expect it is the sudo. Read up on those config files. I think there is a way of doing that without having to use sudo.
 
Old 02-08-2024, 11:44 AM   #7
soccerdude71
LQ Newbie
 
Registered: Feb 2024
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jmccue View Post
You do not what that That will result in yet another mega systemd mega-thread. Go a google search for answer.

I know little about systemd, but I expect it is the sudo. Read up on those config files. I think there is a way of doing that without having to use sudo.

I have already googled... That's why I ended up here. But TY for trying.
 
Old 02-08-2024, 12:23 PM   #8
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,863

Rep: Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311
Quote:
Originally Posted by soccerdude71 View Post
But this is an EXACT copy and paste of the command that is working.... You're just not seeing the whole copy/paste from nano. But if you look at my script at the top, that is what is in there:

sudo cgminer -o stratum+tcp://us-east.stratum.braiins.com:3333 -u soccerdude71.GekkoMiners -p x --suggest-diff 442 --gekko-compacf-freq 400 --gekko-start-freq 300 --gekko-tune-up 85 --gekko-mine2 --gekko-tune2 60
Sorry, it is still not a systemd error, but a misconfiguration.
'60User=pi' is definitely not a number, I have to agree with it. Probably systemd is not good enough to convert it into a number or it has no any idea how should a number look like. But I would rather try to find where is it coming from. Additionally I understand it is not the command you posted, it should be something else.
For*example User=pi would be the next line, but for an unknown reason it concatenates the two lines together. I can imagine there is a strange char at the end of the ExecStart line.
 
Old 02-08-2024, 02:54 PM   #9
soccerdude71
LQ Newbie
 
Registered: Feb 2024
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pan64 View Post
Sorry, it is still not a systemd error, but a misconfiguration.
'60User=pi' is definitely not a number, I have to agree with it. Probably systemd is not good enough to convert it into a number or it has no any idea how should a number look like. But I would rather try to find where is it coming from. Additionally I understand it is not the command you posted, it should be something else.
For*example User=pi would be the next line, but for an unknown reason it concatenates the two lines together. I can imagine there is a strange char at the end of the ExecStart line.
I moved user=pi to the next line. Same thing. I'll post the status shortly.

Last edited by soccerdude71; 02-08-2024 at 03:41 PM.
 
Old 02-08-2024, 03:43 PM   #10
soccerdude71
LQ Newbie
 
Registered: Feb 2024
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by soccerdude71 View Post
I moved user=pi to the next line. Same thing. I'll post the status shortly.

systemctl status BTC_miners_on_startup.service
● BTC_miners_on_startup.service - Turns on BTC USB miners on startup
Loaded: loaded (/lib/systemd/system/BTC_miners_on_startup.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2024-02-08 10:29:29 PST; 3h 12min ago
Process: 502 ExecStart=sudo /home/pi/cgminer/cgminer -o stratum+tcp://us-east.stratum.braiins.com:3333 -u soccerdud> Main PID: 502 (code=exited, status=1/FAILURE)
CPU: 297ms

Feb 08 10:29:27 raspberrypi systemd[1]: Started Turns on BTC USB miners on startup.
Feb 08 10:29:28 raspberrypi sudo[502]: root : PWD=/ ; USER=root ; COMMAND=/home/pi/cgminer/cgminer -o stratum+tcp:/>Feb 08 10:29:28 raspberrypi sudo[502]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=0)
Feb 08 10:29:29 raspberrypi sudo[513]: Error opening terminal: unknown.
Feb 08 10:29:29 raspberrypi sudo[502]: pam_unix(sudo:session): session closed for user root
Feb 08 10:29:29 raspberrypi systemd[1]: BTC_miners_on_startup.service: Main process exited, code=exited, status=1/FAILU>Feb 08 10:29:29 raspberrypi systemd[1]: BTC_miners_on_startup.service: Failed with result 'exit-code'.
lines 1-14/14 (END)...skipping...
● BTC_miners_on_startup.service - Turns on BTC USB miners on startup
Loaded: loaded (/lib/systemd/system/BTC_miners_on_startup.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2024-02-08 10:29:29 PST; 3h 12min ago
Process: 502 ExecStart=sudo /home/pi/cgminer/cgminer -o stratum+tcp://us-east.stratum.braiins.com:3333 -u soccerdude71.GekkoMinersx4 -p x --suggest-dif>
Main PID: 502 (code=exited, status=1/FAILURE)
CPU: 297ms

Feb 08 10:29:27 raspberrypi systemd[1]: Started Turns on BTC USB miners on startup.
Feb 08 10:29:28 raspberrypi sudo[502]: root : PWD=/ ; USER=root ; COMMAND=/home/pi/cgminer/cgminer -o stratum+tcp://us-east.stratum.braiins.com:3333 -u>
Feb 08 10:29:28 raspberrypi sudo[502]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=0)
Feb 08 10:29:29 raspberrypi sudo[513]: Error opening terminal: unknown.
Feb 08 10:29:29 raspberrypi sudo[502]: pam_unix(sudo:session): session closed for user root
Feb 08 10:29:29 raspberrypi systemd[1]: BTC_miners_on_startup.service: Main process exited, code=exited, status=1/FAILURE
Feb 08 10:29:29 raspberrypi systemd[1]: BTC_miners_on_startup.service: Failed with result 'exit-code'.
 
Old 02-09-2024, 02:10 AM   #11
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,863

Rep: Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311
No, it is not the same thing. You have now another error message: Error opening terminal: unknown.
 
Old 02-09-2024, 02:12 PM   #12
soccerdude71
LQ Newbie
 
Registered: Feb 2024
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pan64 View Post
No, it is not the same thing. You have now another error message: Error opening terminal: unknown.
LOL - So do you have a suggestion, or just here to point out my noobness?
 
Old 02-10-2024, 02:59 AM   #13
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,863

Rep: Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311
Yes, you solved one error, but there is another one. I guess there can be other similar errors in that service file, but I can't check it for you.
It is either syntactically incorrect (contains invalid/superfluous chars or just missing something) or there can be other issues too. I can't log in to your host and I can't check your system.
I guess you copied that from windows, that can cause similar issues, but obviously I don't really know.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: The Story Behind ‘init’ and ‘systemd’: Why ‘init’ Needed to be Replaced with ‘systemd’ in Linu LXer Syndicated Linux News 1 04-07-2017 11:33 PM
Can't access full journalctl from script via systemd service even though user is in systemd-journal group iwtbf Linux - Newbie 0 02-19-2016 02:44 PM
LXer: Why pro-systemd and anti-systemd people will never get along LXer Syndicated Linux News 0 05-15-2015 11:44 PM
LXer: Is systemd as bad as boycott systemd is trying to make it? LXer Syndicated Linux News 0 09-03-2014 05:50 PM
Boot Delay 30min: systemd-analyze blame systemd-tmpfiles-setup.service BGHolmes Fedora 0 07-27-2011 09:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration