Giter Site home page Giter Site logo

Init script? about mango HOT 15 CLOSED

getmango avatar getmango commented on May 21, 2024
Init script?

from mango.

Comments (15)

DuraMorte avatar DuraMorte commented on May 21, 2024 1

That must be a leftover from my futile attempts to get a script working before... I'm investigating. Thanks!

from mango.

DuraMorte avatar DuraMorte commented on May 21, 2024 1

So, in total, there will be Mango files in three places:

  1. the database files, located at ~/mango
  2. the binary, located in /usr/local/bin/
  3. the config file, located at ~/.config/mango

I got that all straightened out, and sure enough, #19 went away as well. I don't know how I managed to misplace the files like that, but I appreciate you noticing my error. :)

from mango.

DuraMorte avatar DuraMorte commented on May 21, 2024

Disregard. Found it. :)

from mango.

hkalexling avatar hkalexling commented on May 21, 2024

This repository does not include a startup script. Where did you find it?

If mine is acceptable, I'd be happy to contribute it.

Sure! Contributions are always welcome. Feel free to submit a pull request if you want :D

from mango.

DuraMorte avatar DuraMorte commented on May 21, 2024

from mango.

hkalexling avatar hkalexling commented on May 21, 2024

I see. I think it might be helpful for other users as well. I will work on this and write one, but feel free to contribute if you can get yours working.

I am reopening this issue.

from mango.

hkalexling avatar hkalexling commented on May 21, 2024

I updated the Wiki and included a sample systemd script there. Cheers.

from mango.

DuraMorte avatar DuraMorte commented on May 21, 2024

I tried to implement the script on Ubuntu Server, and it doesn't work.
Below is the error message I'm getting:

● mango.service - Mango manga server service.
Loaded: loaded (/lib/systemd/system/mango.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2020-03-20 18:04:11 CDT; 4s ago
Process: 9004 ExecStart=/bin/bash /usr/bin/mango (code=exited, status=126)
Main PID: 9004 (code=exited, status=126)

Mar 20 18:04:11 ubuserv systemd[1]: Started Mango manga server service..
Mar 20 18:04:11 ubuserv bash[9004]: /usr/bin/mango: /usr/bin/mango: cannot execute binary file
Mar 20 18:04:11 ubuserv systemd[1]: mango.service: Main process exited, code=exited, status=126/n/a
Mar 20 18:04:11 ubuserv systemd[1]: mango.service: Failed with result 'exit-code'.

Any ideas on what could be causing this?

from mango.

hkalexling avatar hkalexling commented on May 21, 2024

Process: 9004 ExecStart=/bin/bash /usr/bin/mango (code=exited, status=126)

Here you are telling systemd to run the mango binary file using bash. /bin/bash can only run bash scripts and not binary files, and that's why you got the error. Try replacing it with

ExecStart=/usr/bin/mango

which runs the binary directly.

from mango.

DuraMorte avatar DuraMorte commented on May 21, 2024

Reworked some things, now I'm getting a new error.

● mango.service - Mango manga server
Loaded: loaded (/lib/systemd/system/mango.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Fri 2020-03-20 18:38:09 CDT; 4s ago
Process: 10750 ExecStart=/usr/local/bin/mango (code=exited, status=203/EXEC)
Main PID: 10750 (code=exited, status=203/EXEC)

journalctl -xe shows this:

Mar 20 18:38:39 ubuserv systemd[1]: Started Mango manga server.
-- Subject: Unit mango.service has finished start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support

-- Unit mango.service has finished starting up.

-- The start-up result is RESULT.
Mar 20 18:38:39 ubuserv systemd[10796]: mango.service: Failed to execute command: Permission denied
Mar 20 18:38:39 ubuserv systemd[10796]: mango.service: Failed at step EXEC spawning /usr/local/bin/mango: Permission denied
-- Subject: Process /usr/local/bin/mango could not be executed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support

-- The process /usr/local/bin/mango could not be executed and failed.

-- The error number returned by this process is 13.
Mar 20 18:38:39 ubuserv systemd[1]: mango.service: Main process exited, code=exited, status=203/EXEC
Mar 20 18:38:39 ubuserv systemd[1]: mango.service: Failed with result 'exit-code'.

Any ideas? I hate to bombard you with this, but it would be super helpful if I didn't have to worry about starting the server manually every time I reboot the VM.

from mango.

hkalexling avatar hkalexling commented on May 21, 2024

Don't worry; I am always happy to help!

This looks like a permission issue. Can you check that the file /usr/local/bin/mango is executable? You might need to run chmod +x /usr/local/bin/mango.

It would be helpful if you could run ls -l /usr/local/bin/mango and paste the output here.

from mango.

DuraMorte avatar DuraMorte commented on May 21, 2024

"user"@ubuserv:/usr/local/bin/mango$ ls -l /usr/local/bin/mango
total 19900
-rwxrwxrwx 1 "user" "user" 19438840 Mar 20 18:10 mango
-rwxrwxrwx 1 "user" root 884736 Mar 20 14:48 mango.db
-rwxrwxrwx 1 "user" root 45056 Mar 15 22:16 queue.db

I can, generally, identify permissions issues by running a chmod 777 * then testing. Unfortunately, this time it isn't quite doing the job. :(

from mango.

DuraMorte avatar DuraMorte commented on May 21, 2024

Works when I run as root. Trying to get away from doing everything as root. Is Mango necessary to run as root?

from mango.

hkalexling avatar hkalexling commented on May 21, 2024

Did you move the entire folder that was supposed to be at ~/mango to /usr/local/bin? You should put only the binary file there. That is, /usr/local/bin/mango should be a single binary file, but from the ls output above it looks like it's a folder on your system.

I guess #19 is also related to this. The two files mango.db and queue.db are the sqlite database files. Moving them there might have confused Mango.

Please try to:

  1. Move the mango folder back to where it was
  2. Move only the mango binary file inside the mango folder to /usr/local/bin

Is Mango necessary to run as root?

No, and you are not supposed to. That's why in the Wiki I suggest running the service using systemctl --user instead of sudo systemctl.

from mango.

hkalexling avatar hkalexling commented on May 21, 2024

Yup, you are right. Glad to know that it's working now!

from mango.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.