[SOLVED] How to restart services compatibly with SysVinit

I'm collaborating on a Kubuntu user's package of scripts for Thinkpad X220 Tablets.  As part of the installation process of the package, the acpid daemon must be restarted to reload newly installed ACPI hooks.  On Kubuntu, the command to restart acpid is:
service acpid restart
According to this page, that should work with systemd, as well.  However, this does not work on my Arch Linux system because the 'service' executable does not exist on my PATH.  There is a 'service' executable in the pm-utils package, but it depends on the existence of a SysVinit script in /etc/rc.d; Arch uses a systemd service file instead.  (Besides, why would something like this be in the pm-utils package, not systemd?)
Using the native systemd command
systemctl restart acpid
works fine for me, but it would be nice to use a single command that's compatible for both systems because it needs to go into a makefile that is used on both systems.  Is it possible to use the same command under SysVinit and systemd to restart a service?
Last edited by kwehmu (2013-11-12 06:37:39)

progandy wrote:
The right way to detect systemd would be this:
if command -v systemd-notify >/dev/null && systemd-notify --booted; then
echo SYSTEMD
else
echo "SOMETHING ELSE (call rc.d, service, ...)"
fi
Thanks, that's helpful.  I'm still wondering why 'service <name> restart' doesn't work, though.  According to the documentation on systemd's website, it should.  Why do you think it doesn't work?  (Is the documentation incorrect, am I misreading the documentation, is 'service' part of another package, etc?)
tomk wrote:Absolutely, this should be left to the user. The Arch way to handle this is with a post-install message, nothing more.
That makes sense, especially for restarting services.  I haven't found any guidelines, though, on what should/shouldn't be included in installation hooks.  For example, 'media-player-info' runs 'udevadm hwdb --update' after installation to update udev's hardware database, and font packages such as 'ttf-dejavu' run multiple commands to update the font database.  What are some guidelines (or where can I find them) on what I should/shouldn't include?

Similar Messages

  • How to use jre6-compat with libreoffice?

    How to use jre6-compat with libreoffice?
    libreoffice + language tool is a sluggish duo when used with jre7, so I have installed jre6-compat in addition to jre7, but I have no idea how to make libreoffice use jre6 from jre6-compat. Jre6 is not listed in Tools>Options>Java.
    I want to keep jre7, because it works well with the other applications.
    [root@goldenfall-archpts1 kuba]# java -version
    java version "1.7.0_09"
    OpenJDK Runtime Environment (IcedTea7 2.3.3) (ArchLinux build 7.u9_2.3.3-1-x86_64)
    OpenJDK 64-Bit Server VM (build 23.2-b09, mixed mode)
    Please advise (in simple terms).
    Last edited by kuba_66 (2013-01-04 05:48:03)

    https://bugs.archlinux.org/task/31812
    No solution so far. But I have no strong interest to fix it. Java7 will soon be the only one in our repos.

  • How to fetch service order with partucular system status and user status

    Hello All,
    How to fetch service orders with specific system status and user status.
    thanks

    I want tables or views from where I can fetch service orders. I have to design ALV report based on this.
    I want to fetch released service orders with status INIT and RENT.
    Here, SYSTEM Status = Released and
             USER Status     = INIT
                                        RENT
    So is there any function module available for the same.....

  • How to restart iPhone 5 with broken power button and frozen home button?

    How to restart iPhone 5 with broken power button and frozen home button?

    hmm..just realised that waiting here for answer is like watching paint drying.. Thanks Apple!
    So best option is..
    1) backup your phone
    2) log to iCloud
    3) erese your phone
    4) pug and restore your phone from backup
    .. I'm clearly starting to dislike this company and seriously considering switching to someone else.

  • How to restart services?

    hi,
    we are using hyperion 11.1.1.3 version which is installed in linux server?Can anyone tell me how to restart the shared services server like we do in windows version...n 1 more question..
    how to start interactive reporting and financial reporting from linux server?if possible can u give me the path(example)
    Thanks in advance...

    Hi,
    If you want to stop and start all the services, (I am assuming the Hyperion Home, check as per ur HYPERION_HOME)
    Go to:
    1) /Hyperion/products/bin
    2) you will find stop.sh and start.sh
    If you want to start a specific service: (Assuming Tomcat, check the locatin of your application server)
    /Hyperion/deployments/Tomcat5/bin
    here you will find Shared Services, along with few more.
    use stopSharedServices9.sh and startSharedServices9.sh
    Cheers...!!!

  • How to setoff service tax with excise payable in a manufacturing company

    hi
    A manufacturing company is collecting service tax from service vendor
    As it is a manufacturing company they wants to setoff the service tax with excise payable in T-Code J2iun
    please tell me how to configure it in the system.

    Have you looked into using Defaulting rules ?
    OM > Setup > Rules > Defaulting rules
    Sandeep Gandhi

  • How much oracle toplink compatable with MySQL in MyEclipse

    Hi All,
    I worked on oracle toplink with oracle database in jdeveloper.
    can anyone tell me how much oracle toplink compatible with mysql database in myeclipse
    any example, demo or url for reference...
    hope for positive reply
    regards,
    abu
    Message was edited by:
    asufian

    MySQL is one of the primary databases that TopLink supports.
    TopLink supports any SQL database with a valid JDBC driver, and has built-in extensions for many databases.
    See,
    http://wiki.eclipse.org/EclipseLink/FAQ/JPA#What_databases_are_supported.3F
    EclipseLink's primary test database is MySQL.
    -- James : http://www.eclipselink.org

  • [solved] How to restart all services with systemd?

    I had the habit of restarting all daemons after an upgrade so to make sure the newest libraries, configuration files etc were loaded. I did that with a shell script that restarted the daemons in order which they were listed in rc.conf. With systemd I could do something similar by first getting a list of running services and ordering a 'systemcrl restart  <servicename>' for each. But since systemd keeps track of dependencies I wonder if that would be the way to do it. Also I would need to filter out 'one shot' type services that are only needed on bootup.
    <edit>restart instead of reload</edit>
    <edit>solved it with a little script</edit>
    Last edited by rwd (2012-11-27 21:02:02)

    I think that's what systemctl snapshot does.
    snapshot [NAME]
               Create a snapshot. If a snapshot name is specified, the new snapshot will be named after it. If none is specified an automatic snapshot name is generated. In either case, the snapshot name used is printed to STDOUT, unless --quiet is specified.
               A snapshot refers to a saved state of the systemd manager. It is implemented itself as a unit that is generated dynamically with this command and has dependencies on all units active at the time. At a later time the user may return to this state by using the isolate command on the snapshot unit.
               Snapshots are only useful for saving and restoring which units are running or are stopped, they do not save/restore any other state. Snapshots are dynamic and lost on reboot.
    Then, isolate emergency.target or rescue target and switch to the snapshot.

  • How configure reporting services configuration with sql server business development studio

    I have installed sql server 2008 r2 mixed mode(sql server authentication) with native mode
    I want to run report using reporting  services config manager.
    I made report in ssrs and I have configured reporting services configuration and  web url from RSCM( reporting  services config manager), i put on ssrs report.
    report is build and deployed but when i take deployed url on Internet explorer, it shows the window below:
    when I put the password nothing happened . if I put url in google chrome then it shows authentication required window like the same in IE
    if I passed username=(levent/sa) and password then goes on window but does not see on page,  if I passed only administrator name (levent) not passed sql server login name (sa) then does not close 'Authentication window'
    'Computer connect net with modem'
    before i tried on earlier PC, it worked fine.
    setting is below link like this.
    only set service Account is Use_built=NetworkSrvice 
    link
    http://www.azurecurve.co.uk/2012/02/how-to-configure-sql-server-reporting-services-in-order-to-deploy-reporting-services-reports-in-gp/
    what is the problem 
    Plz give suggestion quickly

    Hi tusharshinde,
    Per my understanding that when you log in the report Manager you got the pop-up window ask for credential, you try to enter  the SA account and the window account as the username and password but both not work, right?
    Your issue related to the authentication. As you mentioned you have choose the ”Network Service” as the Service account, generally using this account in RSCM and RSWindowsNegotiate is added to the RSReportServer.config file as the default setting. With this
    setting, the report server can accept requests from client applications requesting Kerberos or NTLM authentication. If Kerberos is requested and the authentication fails, the report server switches to NTLM authentication and prompts the user for credentials
    unless the network is configured to manage authentication transparently.
    The issue can be caused by many factors and please check one by one.
    Did you enter the username and password for three times and got blank page or got some error? If you got some error, please provide the error information.
    you can delete the specific Authorization Types inside rsreportserver.config  file, open path:” \Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportServer\rsreportserver.config”. 
    Search the file for the “AuthenticationTypes” section. Remove RSWindowsNegotiate and RSWindoeBasic to ensure only “RSWindowsNTLM” is specified in the file rsreportserver.config file.
    Before do any modification, back up the files and remember to restart the ReportServer instance in the RSCM after the modification.
    If step1 doesn’t work ,please also do the trusted Site Setting in the Browser, article with details steps for your reference:
    http://technet.microsoft.com/en-us/library/bb630430.aspx 
    Please check the Report Manager's authentication mode.Have a look in the Report Manager's web.config file to check if you can find below information under the <system.web> (Path is “C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting
    Services\ReportManager\Web.config ” ).
    authentication mode="Windows"
    identity impersonate="True"
    Similar threads for your reference:
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/23c5daa0-3232-4e8c-89c9-4526960c9d14/ssrs-2008-credentials-login-prompt?forum=sqlreportingservices
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/0778e2ca-0fb1-4b5c-996c-6e327b5e1473/user-logon-credentials-for-ssrs-web-server-setup?forum=sqlreportingservices
    Please tried to provide us more details information, if the problem still exists:
    Did you login in the report manager locally or remotely via Browser and which URL you are using to login the Report manager?
    Did you modified some configuration file before and what did you modified?
    Did your windows account have the right permission to access the report manager?
    Any problem, please feel free to ask.
    Regards
    Vicky Liu

  • How far is the compatibility with PowerPoint and Keynote '09?

    Hello everyone
    I love making presentations and strangely while I'm an Apple fan the only thing I still didn't convert to is iWork
    Keynote is the best presentation tool I ever saw. The problem is with playing the presentations in college or anywhere else.
    I know that keynote is compatible with PowerPoint, but how far?
    Will the beautiful transitions and animations on keynote work on PowerPoint? Alongside with the beautiful graphics, charts and backgrounds?
    Thanks

    I would say the compatibility is "just good enough". If you NEED to use it you will, but you don't want to ever NEED it.
    You shoud think of the compatibility as being like trying to playback high resolution, color, widescreen, Dolby stereo content on a small black and white mono tv. There are some things that old telly just won't be capable of. Sure, you can see the motion and hear something, but you're ultimately limited by what you use to PLAYBACK the content, not what you used to CREATE it.
    Because Keynote has features that PowerPoint doesn't, PowerPoint will never be able to playback exactly what you see in Keynote. The reverse is true as well.

  • How to restart services in windows and solaris environment?

    I need to start services running in windows and solaris platforms with java code. I have a fair idea how to do in C++ . So wondering if same can be done with java. .. Please help me out!
    Thanx

    you may also like to look at the wrapper project on source forge. It lets you set up services under any O/S with full control of the JVM that is running.
    Btw my previous answer only helps you under MS, didn't notice that you wished to know how to do it under unix. If its a non-java service, you will need to determine what platform your on and then perform the appropriate action.

  • How to create 'service' tier with functionality multiple struts apps

    I am looking for some advice regarding a future project. I have 3 struts webapps (running on Tomcat 4.1.3) each with some overlapping functionality. I would like to create a 'service tier' to accommodate common functionality which can be shared between the 3 struts web apps.
    What framework would best achieve this? Are EJBs the way to go? My struts apps all use DTOs so are not tied to the Action Form object. I have been looking at Spring but am not sure exactly how this will fit? Will tomcat serve my needs or do I need to migrate to something with full J2EE support. I have also considered JBOSS with Seam linking JSF to EJBs. Is this a viable option?
    The service layer can be on the same machine as the struts apps although I would like to have the flexibility to move it to a separate server in the future if necessary.
    I will be happy to provide more details to any who can offer me some guidance.

    Hi Saish,
    Thanks for your help.
    I have considered both options. The main goal is to
    eliminate duplicate code. However the presentation
    tiers of the applications are quite different. I
    will look into Martins book.
    It's outstanding. One of my top five favorite books.
    Would creating a jar file which is included in each
    .war end up becomming a maintenance nightmare?
    Depends on what you mean by ' maintenance'. In terms of onging development with your Java source, in a modern IDE, no. In terms of deployment, it does add a minor bit of complexity. However, if you are using an automated build and deployment tool such as Ant or Maven, the amount of extra work is trivial.
    In your opinion what would be the advantages of
    implementing the common functionality as a seperate
    tier (with SPRING/EJB) vs using a JAR file and
    distributing it with each app?They are not mutually exclusive. If you want to remove duplicate code, then simple refactoring is the start. As part of that refactoring, you may decide enough classes are providing similar functionality (such as transaction management, a coarse-grained public API, etc.) and create a tier. You mentioned in particular a service tier. This is a design and architectural decision. You could still completely refactor common functionality into a better design without the introduction of a new tier.
    Whether to create a tier is, IMO, more art than science. Adding a tier adds complexity. However, the net effect should be to reduce system complexity. It is more 'work' to implement a true persistence tier than to simply code JDBC in model objects (or use Hibernate/JDO objects). However, as overall system complexity grows, the addition of a persistence tier adds many benefits. Business objects concern themselves solely with business logic, where as data acccess objects concern themselves with persistence. You can even have different developers with different skills specialize within a tier.
    So, tiering really is a big topic. Fortunately, there are many architecture templates and design patterns to guide your decisions. "Patterns of Enterprise Architecture" (also by Fowler) compares and contrasts the more common ones. There is lively debate as to the pros and cons of different strategies. In the end, there is no cookie-cutter architecture. You will need (sometimes through the painful process of making a mistake) to see what works best for your actual system.
    Finally, about remoting. Remember the first law of distributed objects, "Don't distribute your objects". There is always a performance penalty compared to an in-JVM local call. Remoting has its uses, but these should be careful architecture-level decisions. (I should concded that even this paragraph is sometimes contentious and debated).
    - Saish

  • How to restart service as a recovery task for spacific monitor ?

    Hi,
    I enable a monitor "WMI Health Monitor"
    This monitor checks whether WMI is healthy by periodically performing a WMI query
    while i was Creating  a recover task To restart wmi service I Get the below error
    Date: 1/16/2014 7:39:16 PM
    Application: Operations Manager
    Application Version: 7.0.9538.1084
    Severity: Error
    Message:
    : Verification failed with 1 errors:
    Error 1:
    Found error in 1|Restart.WMI|1.0.0.0|MomUIGenaratedRecovery1326b748249640299aba88d5b0aa8bb7|| with message:
    Target class Microsoft.SystemCenter.HealthService for Recovery MomUIGenaratedRecovery1326b748249640299aba88d5b0aa8bb7 does not derive from Target class Microsoft.SystemCenter.Agent of the monitor (Microsoft.SystemCenter.WMIFunctionalMonitor) that this recovery
    is assigned to.
    : Target class Microsoft.SystemCenter.HealthService for Recovery MomUIGenaratedRecovery1326b748249640299aba88d5b0aa8bb7 does not derive from Target class Microsoft.SystemCenter.Agent of the monitor (Microsoft.SystemCenter.WMIFunctionalMonitor) that this recovery
    is assigned to.

    Found a blog talking about it. See if it helps.
    http://stefanroth.net/2012/11/14/scom-2012-recovery-task-script-for-restarting-a-windows-service-and-depending-services/
    Juke Chou
    TechNet Community Support

  • How to do service callout with the incoming JMS message in OSB 11g

    Hello All,
    I have a specific requirement for which I am creating a kind of POC where I need some help in OSB, however am new to OSB.
    My Environment:
    1> I have a request queue (deployed on a WLS domain) - WFReq_WS
    2> I have a response queue (deployed on a WLS domain) - WFRes_WS
    3> I have created a ProxyService (request/response type) in OSB 11g which is simply mapping the incoming message in WFReq_WS to WFRes_WS
    4> I have a WebService (it is currently a simple hello WebService for testing) which takes a string and returns the same string with an added 'Hi' in front of it (e.g. If you send Jack, it will return 'Hi Jack')
    My Requirement:
    1> I have to do some mechanism in OSB, by which while mapping the message from WFReq_WS to WFRes_WS (through the proxy service I have), it will pick the JMS message (which will be a string/text) and will make a service callout to the Webservice I mentioned using the message as the input parameter of the WebService.
    2>Now when the response of the WebService will come, OSB should send this response as the message in the response queue (WFRes_WS) I mentioned above.
    To simplify the requirement using an example:
    A> I will send a text/String message (say Jack) to the request queue (WFReq_WS)
    B> OSB should pick the message (Jack) and make a service callout to the webservice
    C> webservice will return 'Hi Jack'
    D> OSB should send this to the response queue (WFRes_WS)
    I know the above might look very basic question to the PROs, but please elaborate (step by step) what need to be done, since I do not know OSB.
    Thanks a lot for your help !

    Your example points A and D are easily done by having a "Proxy Service" which has the following details:
    Service Type = Messaging Service
    Request and Response type = Text
    Protocol = jms
    Endpoint URI = your request queue (format like 'jms://localhost:7013/weblogic.jms.XAConnectionFactory/QueueJNDIName')
    Checkmark "response" so that the proxy service automatically delivers the response to another queue - your response queue
    Response URI = jms://localhost:7013/weblogic.jms.XAConnectionFactory/QueueResponse
    Now since your "Hello" webservice is (probably) a SOAP xml service you need to "convert" your text based JMS message to xml before sending it on to the "Hello" service.
    Your JMS proxy can do that by just doing a "Assign <whom>{$body/text()}</whom>" to a variable (lets call it 'reqHello')
    Now your JMS proxy should actually call the Hello service and since your JMS proxy is text and the Hello service is SOAP you cannot just "pass" on to the Hello service in a "Route to". Instead you can do a Service Callout where you can specify your "reqHello" variable as payload and a "respHello" as response variable.
    Now you have the "<whom>Hi jack</whom>" in the response variable and since the JMS response needs to be text format you can "extract" the text value into the body variable of the JMS proxy (use "replace /* in body with $respHello/text()" - replace node contents)
    The actual Hello service is a simple "SOAP" based Proxy Service. Add a pipeline and add a stage in the reponse pipeline. Do a ...
    Assign fn:concat("Hi ",$body/whom/text()) to $whomVar
    Replace whom in body with $whomVar (replace node contents)

  • [solved]How to compile a software with debug symbol from aur?

    How does auch developers compile their project? Seems that archlinux user always trying to avoid build software from git/svn directly. But after searching a lot  I sill haven't found how to compile with debug symbol while using PKGBUILD.
    Anyone help?
    Last edited by ranjiao (2009-08-27 14:28:09)

    ranjiao wrote:PKGBUILD calls autogen.sh before calling make, and gnome-autogen.sh is called in autogen.sh
    I have tried to add --enable-debug while calling autogen.sh and gnome-autogen.sh, but it doesn't work.
    Isn't PKGBUILD just a script? It calls what you make it calls by adding commands...

Maybe you are looking for