You are not logged in.

#1 2012-12-10 15:13:20

winjeg
Member
Registered: 2012-12-10
Posts: 2

I just don't know where to put my auto-start script

Any kind of help is appreciated.


I tried this :
=========================
[winjeg@gpc ~]$ cat /etc/systemd/system/startup.service
[Unit]
Description=A Start Up Demon Using Bash script
After=syslog.target
Before=wicd.target

[Service]
ExecStart=/etc/startup

[Install]



========================
then I use systemctl enable the service but , still it doesn't work.

Offline

#2 2012-12-10 15:19:40

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: I just don't know where to put my auto-start script

I think it's because you have nothing in the [Install] section.  That's how systemd knows where to place the symlink.

My startup.service:

[Unit]
Description=Startup
After=network.target

[Service]
ExecStart=/usr/local/bin/startup.sh

[Install]
WantedBy=multi-user.target

Also, please learn to use BBcode.


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#3 2012-12-10 15:24:13

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,422
Website

Re: I just don't know where to put my auto-start script

You don't really need an install or to use `systemctl enable`.  "enable" just symlinks .service files into the appropriate directory.  If you are creating the file yourself you can just put it in the right directory.  In this case just move it to the subfolder of it's current location for mult-user.target


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#4 2012-12-10 15:24:50

winjeg
Member
Registered: 2012-12-10
Posts: 2

Re: I just don't know where to put my auto-start script

alphaniner wrote:

I think it's because you have nothing in the [Install] section.  That's how systemd knows where to place the symlink.

My startup.service:

[Unit]
Description=Startup
After=network.target

[Service]
ExecStart=/usr/local/bin/startup.sh

[Install]
WantedBy=multi-user.target

Also, please learn to use BBcode.


Sorry , I forget to post this

WantedBy=multi-user.target

Indeed , I added this .

Offline

Board footer

Powered by FluxBB