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,619

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
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,698
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


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Online

#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