LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-28-2019, 12:39 PM   #1
lanz80
LQ Newbie
 
Registered: Jun 2019
Posts: 1

Rep: Reputation: Disabled
Failed to start mount-local.service: Unit not found. ( When trying to start the systemctl servive)


Hello,

I have created in
Code:
/usr/lib/systemd/system/mount-local.service
the following service:
Code:
[Unit]
Description=mount local samba file system
After=syslog.target network.target nss-lookup.target smb.service nmb.service
Requires=smb.service nmb.service

[Service]
Type=oneshot
ExecStart=/bin/mount -a

[Install]
WantedBy=multi-user.target
After that I enable the service

Code:
# systemctl enable  mount-local.service
Created symlink from /etc/systemd/system/multi-user.target.wants/mount-local.service to /usr/lib/systemd/system/mount-local.service.
After that I go to
Code:
 cd /etc/systemd/system
create a soft link the called
Code:
 mount-local.service
that points to
Code:
 /usr/lib/systemd/system/mount-local.service
in order to restart the service from this location when it necessary.

Code:
 ln -s /usr/lib/systemd/system/mount-local.service  mount-local.service  

lrwxrwxrwx  1 root root   43 Jun 28 19:32 mount-local.service -> /usr/lib/systemd/system/mount-local.service
If I type

Code:
 
# systemctl list-unit-files --type service mount-local.service

UNIT FILE           STATE
mount-local.service enabled


1 unit files listed.
Seems be Ok but, when I execute the service to test it:

Code:
systemctl start mount-local.service

Failed to start mount-local.service: Unit not found.
The "funny thing" is that if I execute:

Code:
systemctl stop mount-local.service
It seems to work, but not the start


Anyone knows what I am doing wrong?

Thanks in advance for help!!!

Regards
 
Old 06-29-2019, 05:04 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 21,504

Rep: Reputation: 4113Reputation: 4113Reputation: 4113Reputation: 4113Reputation: 4113Reputation: 4113Reputation: 4113Reputation: 4113Reputation: 4113Reputation: 4113Reputation: 4113
I prefer using autofs or systemd automount instead but have a look at the ArchWiki for using a systemd unit.

https://wiki.archlinux.org/index.php...s_systemd_unit
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
failed to start mysql.service: unit mysq.lservice not found dgabas Linux - Newbie 3 06-04-2019 01:44 AM
systemctl status postgresql-tst.service starts the service if service is stopped MarianForums Linux - Newbie 7 11-03-2018 03:02 PM
Restart systemctl*daemon​ - systemctl command not found cjosephl Linux - Newbie 7 11-11-2017 04:53 PM
Job for vncserver@:1.service failed. See 'systemctl status vncserver@:1.service' and anis123 Linux - Server 0 09-16-2015 08:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:24 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