LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 08-06-2017, 02:25 PM   #1
abefroman
Senior Member
 
Registered: Feb 2004
Location: lost+found
Distribution: CentOS
Posts: 1,430

Rep: Reputation: 55
What does the %i mean here, and why is it blank? (systemctl Centos7)


What does the %i mean here, and why is it blank? (systemctl Centos7)

Code:
# cat /usr/lib/systemd/system/clamd.service 
[Unit]
Description = clamd scanner (%i) daemon
After = syslog.target nss-lookup.target network.target

[Service]
Type = simple
ExecStart = /usr/sbin/clamd -c /etc/clamd.d/%i.conf --foreground=yes
Restart = on-failure
PrivateTmp = true
And in /var/log/messages I'm getting:
Code:
clamd: ERROR: Can't open/parse the config file /etc/clamd.d/.conf
The actual files is called /etc/clamd.d/scan.conf, although I could rename that if needed. If I rename it to just ".conf" it works, but clearly its suppose to be putting the %i variable there.

Code:
# mv scan.conf .conf
# service clamd start
Redirecting to /bin/systemctl start  clamd.service
# netstat -lntp |grep clamd
tcp        0      0 127.0.0.1:3310          0.0.0.0:*               LISTEN      28159/clamd
Thanks in advance!!!!
 
Old 08-06-2017, 02:42 PM   #2
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by abefroman View Post
What does the %i mean here, and why is it blank? (systemctl Centos7)
Code:
# cat /usr/lib/systemd/system/clamd.service 
[Unit]
Description = clamd scanner (%i) daemon
After = syslog.target nss-lookup.target network.target
%i can be a denote for a data type to spit out info if valid.

Quote:
[Service]
Type = simple
ExecStart = /usr/sbin/clamd -c /etc/clamd.d/%i.conf --foreground=yes
Restart = on-failure
PrivateTmp = true
as you see it again in
Code:
%i.config
// where it cound be like a wildcard but it is suppose to have a value to it. Because
where we look down here we see what for a filename ?
Quote:

And in /var/log/messages I'm getting:
Code:
clamd: ERROR: Can't open/parse the config file /etc/clamd.d/.conf
The actual files is called /etc/clamd.d/scan.conf, although I could rename that if needed. If I rename it to just ".conf" it works, but clearly its suppose to be putting the %i variable there.
you will have to go find where %i is assinging the value to it and how it is getting same said value.
Code:
i = value

Quote:
Code:
# mv scan.conf .conf
# service clamd start
Redirecting to /bin/systemctl start  clamd.service
# netstat -lntp |grep clamd
tcp        0      0 127.0.0.1:3310          0.0.0.0:*               LISTEN      28159/clamd
Thanks in advance!!!!
I'd read this and see if that is closer to what you need to know.
https://forum.vestacp.com/viewtopic.php?f=41&t=11795

bottom post ..
 
Old 08-06-2017, 03:42 PM   #3
abefroman
Senior Member
 
Registered: Feb 2004
Location: lost+found
Distribution: CentOS
Posts: 1,430

Original Poster
Rep: Reputation: 55
Quote:
Originally Posted by BW-userx View Post
%i can be a denote for a data type to spit out info if valid.
Likes a integer data type?

Is systemctl wanting a parameter?

Ex.
Code:
systemctl start clamd scan
 
Old 08-06-2017, 05:01 PM   #4
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
%i is a specifier representing the instance name:

Quote:
For instantiated units: this is the string between the "@" character and the suffix of the unit name.
See Specifiers section here:

https://www.freedesktop.org/software...temd.unit.html
 
Old 08-06-2017, 05:15 PM   #5
abefroman
Senior Member
 
Registered: Feb 2004
Location: lost+found
Distribution: CentOS
Posts: 1,430

Original Poster
Rep: Reputation: 55
Quote:
Originally Posted by hydrurga View Post
%i is a specifier representing the instance name:
Are you saying it should be:
/usr/lib/systemd/system/clamd@.service
instead of:
/usr/lib/systemd/system/clamd.service
?

And the config file clamd.conf instead of scan.conf ?

Last edited by abefroman; 08-06-2017 at 05:19 PM.
 
Old 08-07-2017, 03:25 AM   #6
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by abefroman View Post
Are you saying it should be:
/usr/lib/systemd/system/clamd@.service
instead of:
/usr/lib/systemd/system/clamd.service
?

And the config file clamd.conf instead of scan.conf ?
I'm no expert, I just came up with that info after a quick web search.

However I would have thought that the "between" would imply "and not including".
 
  


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
[SOLVED] /bin/systemctl overload dlb101010 Linux - Newbie 5 12-13-2016 08:32 AM
Systemctl command error gowlet CentOS 3 06-06-2016 04:13 AM
is systemctl here to stay? zQUEz Linux - General 3 11-18-2012 06:55 AM
Fedora 16 systemctl error Pierredup Linux - Server 3 04-15-2012 12:25 PM
sshd : redirecting to systemctl mohamed makhyoun Linux - Software 5 01-16-2012 12:25 AM

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

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