I just found an example of exactly what I'm trying to do:
> ssh -p 29418 -i site_path/etc/ssh_host_rsa_key 'Gerrit Code Review'@localhost gerrit flush-caches --all
http://gerrit-documentation.googlecode.com/svn/ReleaseNotes/ReleaseNotes-2.1.2.html#_server_administration
But this ends up with the following warning:
> [2012-10-02 01:04:50,999] WARN com.google.gerrit.sshd.CommandFactoryProvider : Cannot start command "gerrit flush-caches --list" for user Gerrit Code Review
> com.google.inject.ProvisionException: Guice provision errors:
>
> 1) Not Signed In
> at com.google.gerrit.server.util.ThreadLocalRequestContext$1.provideCurrentUser(ThreadLocalRequestContext.java:61)
> while locating com.google.gerrit.server.IdentifiedUser
> for field at com.google.gerrit.sshd.commands.FlushCaches.currentUser(FlushCaches.java:34)
> while locating com.google.gerrit.sshd.commands.FlushCaches
> while locating org.apache.sshd.server.Command annotated with CommandName[gerrit flush-caches]
>
> 1 error
> at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:987)
> at com.google.gerrit.sshd.DispatchCommand.start(DispatchCommand.java:80)
> at com.google.gerrit.sshd.DispatchCommand.start(DispatchCommand.java:96)
> at com.google.gerrit.sshd.CommandFactoryProvider$Trampoline.onStart(CommandFactoryProvider.java:170)
> at com.google.gerrit.sshd.CommandFactoryProvider$Trampoline.access$100(CommandFactoryProvider.java:87)
> at com.google.gerrit.sshd.CommandFactoryProvider$Trampoline$1.run(CommandFactoryProvider.java:134)
> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
> at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
> at java.util.concurrent.FutureTask.run(FutureTask.java:166)
> at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:165)
> at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:266)
> at com.google.gerrit.server.git.WorkQueue$Task.run(WorkQueue.java:337)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
> at java.lang.Thread.run(Thread.java:636)
> Caused by: com.google.gerrit.common.errors.NotSignedInException: Not Signed In
> at com.google.gerrit.server.util.ThreadLocalRequestContext$1.provideCurrentUser(ThreadLocalRequestContext.java:64)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:616)
> at com.google.inject.internal.ProviderMethod.get(ProviderMethod.java:104)
> at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
> at com.google.inject.internal.SingleFieldInjector.inject(SingleFieldInjector.java:53)
> at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:110)
> at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:94)
> at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254)
> at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:54)
> at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:978)
> at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1024)
> at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:974)
> ... 14 more
.. and when I try it with suexec (suexec --as
f...@example.org gerrit flush-caches --list), I get
fatal: "--list" is not a valid option
Using gerrit 2.5
Thanks
Steffen
> --
> To unsubscribe, email
repo-discuss...@googlegroups.com
> More info at
http://groups.google.com/group/repo-discuss?hl=en